emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 9759b24: Work around macOS bug in create_process, t


From: Paul Eggert
Subject: [Emacs-diffs] master 9759b24: Work around macOS bug in create_process, too
Date: Sun, 21 May 2017 05:00:35 -0400 (EDT)

branch: master
commit 9759b249e97d4b05644309fc70ae9277b347027e
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    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 c301739..2a1c2ee 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]