diff options
| author | Paul Eggert | 2017-05-21 02:00:02 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-05-21 02:00:29 -0700 |
| commit | 9759b249e97d4b05644309fc70ae9277b347027e (patch) | |
| tree | 46a1f06e5f42f392a70e66b88edca0850ff5acdf /src/process.c | |
| parent | cb6d66974416f535fefb42c974b73037e257399a (diff) | |
| download | emacs-9759b249e97d4b05644309fc70ae9277b347027e.tar.gz emacs-9759b249e97d4b05644309fc70ae9277b347027e.zip | |
Work around macOS bug in create_process, too
* src/process.c (create_process) [DARWIN_OS]:
Reset SIGCHLD after vfork here, too.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/process.c b/src/process.c index c30173955d2..2a1c2eecde3 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -2051,11 +2051,16 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) | |||
| 2051 | 2051 | ||
| 2052 | #ifdef DARWIN_OS | 2052 | #ifdef DARWIN_OS |
| 2053 | /* Darwin doesn't let us run setsid after a vfork, so use fork when | 2053 | /* Darwin doesn't let us run setsid after a vfork, so use fork when |
| 2054 | necessary. */ | 2054 | necessary. Also, reset SIGCHLD handling after a vfork, as |
| 2055 | apparently macOS can mistakenly deliver SIGCHLD to the child. */ | ||
| 2055 | if (pty_flag) | 2056 | if (pty_flag) |
| 2056 | pid = fork (); | 2057 | pid = fork (); |
| 2057 | else | 2058 | else |
| 2058 | pid = vfork (); | 2059 | { |
| 2060 | pid = vfork (); | ||
| 2061 | if (pid == 0) | ||
| 2062 | signal (SIGCHLD, SIG_DFL); | ||
| 2063 | } | ||
| 2059 | #else | 2064 | #else |
| 2060 | pid = vfork (); | 2065 | pid = vfork (); |
| 2061 | #endif | 2066 | #endif |