pipecmd: fix warn-unused-result warnings (-O2)
[ccan] / ccan / pipecmd / pipecmd.c
index e8aec15b4e7f62993489de618a445439ac06c8c7..22903bb34627b0df674f7c14b78dfe7a7907bb74 100644 (file)
@@ -122,7 +122,9 @@ pid_t pipecmdarr(int *fd_fromchild, int *fd_tochild, int *fd_errfromchild,
 
        child_errno_fail:
                err = errno;
-               write(execfail[1], &err, sizeof(err));
+               /* Gcc's warn-unused-result fail. */
+               if (write(execfail[1], &err, sizeof(err)))
+                       ;
                exit(127);
        }