* src/process.c (create_process) [DARWIN_OS]:
Reset SIGCHLD after vfork here, too.
#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