Commit c7054c79 authored by Bruno Haible's avatar Bruno Haible
Browse files

Use module pipe2.

parent d72a5819
2009-08-22 Bruno Haible <bruno@clisp.org>
* lib/pipe.c (create_pipe): Use pipe2 instead of _pipe.
* modules/pipe (Depends-on): Add pipe2.
2009-08-22 Bruno Haible <bruno@clisp.org>
 
Tests for module 'pipe2'.
......@@ -133,12 +133,12 @@ create_pipe (const char *progname,
prog_argv = prepare_spawn (prog_argv);
if (pipe_stdout)
if (_pipe (ifd, 4096, O_BINARY | O_NOINHERIT) < 0
if (pipe2 (ifd, O_BINARY | O_NOINHERIT) < 0
|| (ifd[0] = fd_safer_noinherit (ifd[0])) < 0
|| (ifd[1] = fd_safer_noinherit (ifd[1])) < 0)
error (EXIT_FAILURE, errno, _("cannot create pipe"));
if (pipe_stdin)
if (_pipe (ofd, 4096, O_BINARY | O_NOINHERIT) < 0
if (pipe2 (ofd, O_BINARY | O_NOINHERIT) < 0
|| (ofd[0] = fd_safer_noinherit (ofd[0])) < 0
|| (ofd[1] = fd_safer_noinherit (ofd[1])) < 0)
error (EXIT_FAILURE, errno, _("cannot create pipe"));
......
......@@ -15,6 +15,7 @@ exit
fatal-signal
gettext-h
open
pipe2
spawn
posix_spawnp
posix_spawn_file_actions_init
......
Supports Markdown
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