summaryrefslogtreecommitdiff
path: root/harness
diff options
context:
space:
mode:
Diffstat (limited to 'harness')
-rw-r--r--harness/cases/5.t9
1 files changed, 4 insertions, 5 deletions
diff --git a/harness/cases/5.t b/harness/cases/5.t
index 7d67562..b0a7c56 100644
--- a/harness/cases/5.t
+++ b/harness/cases/5.t
@@ -41,13 +41,12 @@ int test_main(void)
assert(buf != (char *)-1);
/* Whether PROT_WRITE is readable is arch-dependent. So compare
- * against read result. */
- res = read(rwfd, buf, SIZE);
+ * against write() result (to make the kernel read from buf). */
+ res = write(rwfd, buf, SIZE);
if (res < 0)
res = -errno;
- status |= attempt_rw(rwfd, buf, SIZE, 0, READ, res);
-
- status |= attempt_rw(rwfd, buf, SIZE, 0, WRITE, SIZE);
+ status |= attempt_rw(rwfd, buf, SIZE, 0, READ, SIZE);
+ status |= attempt_rw(rwfd, buf, SIZE, 0, WRITE, res);
return status;
}