err: fix warn-unused-result warning in test (-O2)
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 25 Oct 2016 04:44:33 +0000 (15:14 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 25 Oct 2016 04:44:33 +0000 (15:14 +1030)
/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 <rusty@rustcorp.com.au>
ccan/err/test/run.c

index 242e93f8061c246e344a26079f0b0fd2808bb813..c103f7cda6e0039092a5b19e14b2a6adb2008b11 100644 (file)
@@ -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];