diff options
| author | Alan Third | 2017-04-09 20:10:33 +0100 |
|---|---|---|
| committer | Alan Third | 2017-04-18 11:42:30 +0100 |
| commit | a13eaddce2ddbe3ba0b7f4c81715bc0fcdba99f6 (patch) | |
| tree | 5bf3f0b8fbd2187bb5e08261f29811ea269d4a33 /src/process.c | |
| parent | 4ad6be65f68a5c875ecbaa9e66d8ced28f43670a (diff) | |
| download | emacs-a13eaddce2ddbe3ba0b7f4c81715bc0fcdba99f6.tar.gz emacs-a13eaddce2ddbe3ba0b7f4c81715bc0fcdba99f6.zip | |
Use vfork if possible on Darwin (bug#26397)
Co-authored-by: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* src/conf_post.h (HAVE_WORKING_VFORK): Don't undef.
(vfork): Don't define.
* src/process.c (create_process) [DARWIN_OS]: Use fork if pty_flag is
set, otherwise vfork.
* src/callproc.c (call_process) [DARWIN_OS]: Use TIOCNOTTY to detach
the controlling terminal instead of setsid.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/process.c b/src/process.c index b81c7b459e3..0edd092ef66 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -2049,7 +2049,16 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) | |||
| 2049 | int volatile forkerr_volatile = forkerr; | 2049 | int volatile forkerr_volatile = forkerr; |
| 2050 | struct Lisp_Process *p_volatile = p; | 2050 | struct Lisp_Process *p_volatile = p; |
| 2051 | 2051 | ||
| 2052 | #ifdef DARWIN_OS | ||
| 2053 | /* Darwin doesn't let us run setsid after a vfork, so use fork when | ||
| 2054 | necessary. */ | ||
| 2055 | if (pty_flag) | ||
| 2056 | pid = fork (); | ||
| 2057 | else | ||
| 2058 | pid = vfork (); | ||
| 2059 | #else | ||
| 2052 | pid = vfork (); | 2060 | pid = vfork (); |
| 2061 | #endif | ||
| 2053 | 2062 | ||
| 2054 | current_dir = current_dir_volatile; | 2063 | current_dir = current_dir_volatile; |
| 2055 | lisp_pty_name = lisp_pty_name_volatile; | 2064 | lisp_pty_name = lisp_pty_name_volatile; |