From: Paul Eggert Date: Sun, 21 May 2017 09:00:02 +0000 (-0700) Subject: Work around macOS bug in create_process, too X-Git-Tag: emacs-26.0.90~521^2~327 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9759b249e97d4b05644309fc70ae9277b347027e;p=emacs.git Work around macOS bug in create_process, too * src/process.c (create_process) [DARWIN_OS]: Reset SIGCHLD after vfork here, too. --- 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) #ifdef DARWIN_OS /* Darwin doesn't let us run setsid after a vfork, so use fork when - necessary. */ + necessary. Also, reset SIGCHLD handling after a vfork, as + apparently macOS can mistakenly deliver SIGCHLD to the child. */ if (pty_flag) pid = fork (); else - pid = vfork (); + { + pid = vfork (); + if (pid == 0) + signal (SIGCHLD, SIG_DFL); + } #else pid = vfork (); #endif