Mercurial > hg > octave-kai > gnulib-hg
changeset 11872:2770463da68f
Use module pipe2.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sat, 22 Aug 2009 18:58:09 +0200 |
parents | 35ea3cd86bec |
children | 9823635e7b7a |
files | ChangeLog lib/pipe.c modules/pipe |
diffstat | 3 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +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'.
--- a/lib/pipe.c +++ b/lib/pipe.c @@ -133,12 +133,12 @@ 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"));