X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fpipecmd%2F_info;h=a560bfea05ccc4e53807dde67d0546c48b6f0246;hp=1af377bf757bfcffefbed3e1901405e3a06e5600;hb=61f58ff94e35c9b8ac5488554e2554bc5c9888b3;hpb=66de67ea48009a086f940288eacf9928515f3aec diff --git a/ccan/pipecmd/_info b/ccan/pipecmd/_info index 1af377bf..a560bfea 100644 --- a/ccan/pipecmd/_info +++ b/ccan/pipecmd/_info @@ -28,10 +28,11 @@ * 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, argv[0], "ignoredarg", NULL); + * child = pipecmd(&outputfd, NULL, NULL, argv[0], "ignoredarg", NULL); * if (child < 0) * err(1, "Creating child"); * if (read(outputfd, input, sizeof(input)) != sizeof(input))