Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@@ -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);
}