diff options
| author | Paul Eggert | 2013-07-16 00:05:41 -0700 |
|---|---|---|
| committer | Paul Eggert | 2013-07-16 00:05:41 -0700 |
| commit | c7ddc792b747fdf4fde822df0cf9c7b712be4219 (patch) | |
| tree | de532bf42e3675fa093996b13ddb490cb8ec2f6c /src/process.c | |
| parent | e6c005c5f8e39252fd11821b6452843bead2df6a (diff) | |
| download | emacs-c7ddc792b747fdf4fde822df0cf9c7b712be4219.tar.gz emacs-c7ddc792b747fdf4fde822df0cf9c7b712be4219.zip | |
Fix porting bug to older POSIXish platforms.
* sysdep.c (emacs_pipe): New function, that implements
pipe2 (fd, O_CLOEXEC) even on hosts that lack O_CLOEXEC.
This should port better to CentOS 5 and to Mac OS X 10.6.
All calls to pipe2 changed.
Fixes: debbugs:14862
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/process.c b/src/process.c index 94ffc37ffe7..125a9389341 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -1651,11 +1651,11 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) | |||
| 1651 | else | 1651 | else |
| 1652 | #endif /* HAVE_PTYS */ | 1652 | #endif /* HAVE_PTYS */ |
| 1653 | { | 1653 | { |
| 1654 | if (pipe2 (sv, O_CLOEXEC) != 0) | 1654 | if (emacs_pipe (sv) != 0) |
| 1655 | report_file_error ("Creating pipe", Qnil); | 1655 | report_file_error ("Creating pipe", Qnil); |
| 1656 | inchannel = sv[0]; | 1656 | inchannel = sv[0]; |
| 1657 | forkout = sv[1]; | 1657 | forkout = sv[1]; |
| 1658 | if (pipe2 (sv, O_CLOEXEC) != 0) | 1658 | if (emacs_pipe (sv) != 0) |
| 1659 | { | 1659 | { |
| 1660 | int pipe_errno = errno; | 1660 | int pipe_errno = errno; |
| 1661 | emacs_close (inchannel); | 1661 | emacs_close (inchannel); |
| @@ -1667,7 +1667,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) | |||
| 1667 | } | 1667 | } |
| 1668 | 1668 | ||
| 1669 | #ifndef WINDOWSNT | 1669 | #ifndef WINDOWSNT |
| 1670 | if (pipe2 (wait_child_setup, O_CLOEXEC) != 0) | 1670 | if (emacs_pipe (wait_child_setup) != 0) |
| 1671 | report_file_error ("Creating pipe", Qnil); | 1671 | report_file_error ("Creating pipe", Qnil); |
| 1672 | #endif | 1672 | #endif |
| 1673 | 1673 | ||