From: Jeff Moyer Date: Tue, 13 Aug 2019 19:30:05 +0000 (-0400) Subject: [PATCH libaio 25/28] harness: fix read into PROT_WRITE mmap test X-Git-Tag: archive/raspbian/0.3.112-13+rpi1~21 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1f04c5fc4fb3a6b9619534930c51a26e262dd27d;p=libaio.git [PATCH libaio 25/28] harness: fix read into PROT_WRITE mmap test This test has been broken forever. Fix it up to perform an aio_read using the result of a regular read as the expected return code. Reported-by: Guillem Jover Signed-off-by: Jeff Moyer Gbp-Pq: Topic upstream Gbp-Pq: Name 0025-harness-fix-read-into-PROT_WRITE-mmap-test.patch --- diff --git a/harness/cases/5.t b/harness/cases/5.t index 2b4b4bb..7d67562 100644 --- a/harness/cases/5.t +++ b/harness/cases/5.t @@ -40,14 +40,14 @@ int test_main(void) buf = mmap(0, page_size, PROT_WRITE, MAP_SHARED, rwfd, 0); assert(buf != (char *)-1); - status |= attempt_rw(rwfd, buf, SIZE, 0, READ, SIZE); - /* Whether PROT_WRITE is readable is arch-dependent. So compare * against read result. */ res = read(rwfd, buf, SIZE); if (res < 0) res = -errno; - status |= attempt_rw(rwfd, buf, SIZE, 0, WRITE, res); + status |= attempt_rw(rwfd, buf, SIZE, 0, READ, res); + + status |= attempt_rw(rwfd, buf, SIZE, 0, WRITE, SIZE); return status; }