From: Rusty Russell Date: Tue, 25 Oct 2016 04:44:33 +0000 (+1030) Subject: err: fix warn-unused-result warning in test (-O2) X-Git-Url: http://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=1de204600b76e0bfba1f0cebdd2a6a62a04e9e70;ds=sidebyside err: fix warn-unused-result warning in test (-O2) /home/rusty/devel/cvs/ccan/ccan/err/test/run.c:124:2: warning: ignoring return value of ‘pipe’, declared with attribute warn_unused_result [-Wunused-result] pipe(pfd); Signed-off-by: Rusty Russell --- diff --git a/ccan/err/test/run.c b/ccan/err/test/run.c index 242e93f8..c103f7cd 100644 --- a/ccan/err/test/run.c +++ b/ccan/err/test/run.c @@ -27,7 +27,8 @@ int main(int argc, char *argv[]) base = argv[0]; /* Test err() in child */ - pipe(pfd); + if (pipe(pfd)) + abort(); fflush(stdout); if (fork()) { char buffer[BUFFER_MAX+1]; @@ -59,7 +60,8 @@ int main(int argc, char *argv[]) } /* Test errx() in child */ - pipe(pfd); + if (pipe(pfd)) + abort(); fflush(stdout); if (fork()) { char buffer[BUFFER_MAX+1]; @@ -89,7 +91,8 @@ int main(int argc, char *argv[]) /* Test warn() in child */ - pipe(pfd); + if (pipe(pfd)) + abort(); fflush(stdout); if (fork()) { char buffer[BUFFER_MAX+1]; @@ -121,7 +124,8 @@ int main(int argc, char *argv[]) } /* Test warnx() in child */ - pipe(pfd); + if (pipe(pfd)) + abort(); fflush(stdout); if (fork()) { char buffer[BUFFER_MAX+1];