X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ffailtest%2Ftest%2Frun-open.c;h=e055045739d619db301f3cf98cddcb24b0def734;hp=a81fa259334c70298c0c2ac0ed320e23d556ca72;hb=36264d9553f924c8a58ae967f659601d1ff6793a;hpb=ee0626765b8cbf209cece44090e689726ac334ed;ds=inline diff --git a/ccan/failtest/test/run-open.c b/ccan/failtest/test/run-open.c index a81fa259..e0550457 100644 --- a/ccan/failtest/test/run-open.c +++ b/ccan/failtest/test/run-open.c @@ -15,13 +15,15 @@ int main(void) plan_tests(12); - pipe(pfd); + if (pipe(pfd)) + abort(); fd = failtest_open("run-open-scratchpad", "run-open.c", 1, O_RDWR|O_CREAT, 0600); if (fd == -1) { /* We are the child: write error code for parent to check. */ err = errno; - write(pfd[1], &err, sizeof(err)); + if (write(pfd[1], &err, sizeof(err)) != sizeof(err)) + abort(); failtest_exit(0); } /* Check it is read-write. */ @@ -46,12 +48,14 @@ int main(void) close(pfd[1]); /* Two-arg open. */ - pipe(pfd); + if (pipe(pfd) != 0) + abort(); fd = failtest_open("run-open-scratchpad", "run-open.c", 1, O_RDONLY); if (fd == -1) { /* We are the child: write error code for parent to check. */ err = errno; - write(pfd[1], &err, sizeof(err)); + if (write(pfd[1], &err, sizeof(err)) != sizeof(err)) + abort(); failtest_exit(0); } /* Check it is read-only. */