X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpipe.c;h=d17c9bf6c6c9b561dec1e6492890e6ed06d39ef1;hb=a12148fa5481e60f598307f2892da503fefefda6;hp=5d91590f391b391c969ccf397694cff0b1810a17;hpb=f07b9ce8f0e75af44ea9022793b87aebe18ef9d1;p=gnulib.git diff --git a/lib/pipe.c b/lib/pipe.c index 5d91590f3..d17c9bf6c 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")); @@ -185,9 +185,7 @@ create_pipe (const char *progname, && close (stdoutfd) >= 0))))) /* The child process doesn't inherit ifd[0], ifd[1], ofd[0], ofd[1], but it inherits all open()ed or dup2()ed file handles (which is what - we want in the case of STD*_FILENO) and also orig_stdin, - orig_stdout, orig_stderr (which is not explicitly wanted but - harmless). */ + we want in the case of STD*_FILENO). */ /* Use spawnvpe and pass the environment explicitly. This is needed if the program has modified the environment using putenv() or [un]setenv(). On Windows, programs have two environments, one in the "environment