#include #include #include #include void no_zombie (void) { #if !defined (__MINGW32__) && !defined (__MSVCRT__) struct sigaction act; /* Make sure children don't turn into zombies. */ sigemptyset (&act.sa_mask); act.sa_handler = SIG_IGN; #ifdef SA_NOCLDWAIT act.sa_flags = SA_NOCLDWAIT; #else act.sa_flags = 0; #endif #ifdef SA_INTERRUPT act.sa_flags |= SA_INTERRUPT; #endif if (sigaction (SIGCHLD, &act, (struct sigaction *)NULL)) { perror ("sigaction"); exit (errno); } #endif }