]> git.ozlabs.org Git - ccan/blobdiff - ccan/pipecmd/_info
pipecmd: reverse order of args to match documentation; add pipecmd_preserve.
[ccan] / ccan / pipecmd / _info
index 1af377bf757bfcffefbed3e1901405e3a06e5600..8c49511a250c2cbc99f93d4628d80dd0c5c971f2 100644 (file)
  *     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(NULL, &outputfd, NULL, argv[0], "ignoredarg", NULL);
  *     if (child < 0)
  *             err(1, "Creating child");
  *     if (read(outputfd, input, sizeof(input)) != sizeof(input))