? external/mit/ctwm/dist/ChangeLog Index: external/mit/ctwm/dist/signals.c =================================================================== RCS file: /cvsroot/xsrc/external/mit/ctwm/dist/signals.c,v retrieving revision 1.1.1.1 diff -p -u -r1.1.1.1 signals.c --- external/mit/ctwm/dist/signals.c 5 Jul 2023 07:36:07 -0000 1.1.1.1 +++ external/mit/ctwm/dist/signals.c 12 Aug 2023 11:39:39 -0000 @@ -26,6 +26,14 @@ static bool sig_shutdown = false; // needs to trigger an action. bool SignalFlag = false; +#ifdef __NetBSD__ +SIGNAL_T ChildExit(int signum) +{ + int Errno = errno; + waitpid(-1, NULL, WNOHANG); /* reap dead child, ignore status */ + errno = Errno; /* restore errno for interrupted sys calls */ +} +#endif /** * Setup signal handlers (run during startup) @@ -46,9 +54,18 @@ setup_signal_handlers(void) // die... signal(SIGALRM, SIG_IGN); +#ifdef __NetBSD__ + /* Setting SIGCHLD to SIG_IGN detaches children from the parent + * immediately, so it need not be waited for. + * In fact, you cannot wait for it, so a function like system() + * breaks. + */ + signal(SIGCHLD, ChildExit); +#else // This should be set by default, but just in case; explicitly don't // leave zombies. signal(SIGCHLD, SIG_IGN); +#endif return; }