From 9759b249e97d4b05644309fc70ae9277b347027e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 21 May 2017 02:00:02 -0700 Subject: [PATCH] Work around macOS bug in create_process, too * src/process.c (create_process) [DARWIN_OS]: Reset SIGCHLD after vfork here, too. --- src/process.c | 9 +++++++-- 1 file 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) #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 -- 2.39.2