Commit 6280162f authored by Rusty Russell's avatar Rusty Russell

pipecmd: fix warn-unused-result warnings (-O2)

Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent ca8bfcc4
......@@ -28,7 +28,8 @@
* char input[12];
*
* if (argc == 2) {
* write(STDOUT_FILENO, "hello world\n", 12);
* if (write(STDOUT_FILENO, "hello world\n", 12) != 12)
* exit(1);
* exit(0);
* }
* child = pipecmd(&outputfd, NULL, NULL, argv[0], "ignoredarg", NULL);
......
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment