From: Bruno Haible Date: Sat, 22 Aug 2009 16:58:09 +0000 (+0200) Subject: Use module pipe2. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7054c798329aaa675b627e09180b0730eee49f5;p=pspp Use module pipe2. --- diff --git a/ChangeLog b/ChangeLog index 690febdd97..b8aff86cf5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-08-22 Bruno Haible + + * lib/pipe.c (create_pipe): Use pipe2 instead of _pipe. + * modules/pipe (Depends-on): Add pipe2. + 2009-08-22 Bruno Haible Tests for module 'pipe2'. diff --git a/lib/pipe.c b/lib/pipe.c index daf7f7ffea..d17c9bf6c6 100644 --- a/lib/pipe.c +++ b/lib/pipe.c @@ -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")); diff --git a/modules/pipe b/modules/pipe index 570d71d99c..bb1ebeea31 100644 --- a/modules/pipe +++ b/modules/pipe @@ -15,6 +15,7 @@ exit fatal-signal gettext-h open +pipe2 spawn posix_spawnp posix_spawn_file_actions_init