diff --git a/src/racket/src/places.c b/src/racket/src/places.c index 12a5e820fc..692183aaac 100644 --- a/src/racket/src/places.c +++ b/src/racket/src/places.c @@ -592,6 +592,17 @@ void scheme_places_block_child_signal() XFORM_SKIP_PROC MZ_SIGSET(SIGCHLD, got_sigchld); } +void scheme_places_unblock_child_signal() XFORM_SKIP_PROC +{ + sigset_t set; + + MZ_SIGSET(SIGCHLD, SIG_IGN); + + sigemptyset(&set); + sigaddset(&set, SIGCHLD); + sigprocmask(SIG_UNBLOCK, &set, NULL); +} + void scheme_places_start_child_signal_handler() { mz_proc_thread *signal_thread; diff --git a/src/racket/src/port.c b/src/racket/src/port.c index 8ee1d7282f..12f0255788 100644 --- a/src/racket/src/port.c +++ b/src/racket/src/port.c @@ -8106,6 +8106,9 @@ static Scheme_Object *subprocess(int c, Scheme_Object *args[]) #if !defined(MZ_PLACES_WAITPID) scheme_block_child_signals(0); +#else + if (!pid) + scheme_places_unblock_child_signal(); #endif } diff --git a/src/racket/src/schpriv.h b/src/racket/src/schpriv.h index 11c7999202..c43b7b275b 100644 --- a/src/racket/src/schpriv.h +++ b/src/racket/src/schpriv.h @@ -3631,6 +3631,7 @@ Scheme_Object *scheme_places_deep_copy(Scheme_Object *so); # ifdef UNIX_PROCESSES # define MZ_PLACES_WAITPID void scheme_places_block_child_signal(); +void scheme_places_unblock_child_signal(); void scheme_places_start_child_signal_handler(); int scheme_get_child_status(int pid, int is_group, int *status); int scheme_places_register_child(int pid, int is_group, void *signal_fd, int *status);