diff --git a/motif/server/main.c b/motif/server/main.c index 1ac54a10a0c611c5cd96a5ba2f1ffadebfd64fa9..c6bdb9ee1eeee4c5c07efe5bd4d150ea78dc30dc 100644 --- a/motif/server/main.c +++ b/motif/server/main.c @@ -9,6 +9,8 @@ #include <errno.h> #include <signal.h> +#include <sys/wait.h> + #define PORT 8000 #define MAX(x,y) ((x<y)?y:x) @@ -142,6 +144,7 @@ main(int argc, char **argv) fd_set rfds; int nfound,nfds,i; int port = PORT; + union wait status; /* This is so resources can be passed to the servers on the command line */ global_argc = argc; @@ -220,5 +223,7 @@ main(int argc, char **argv) printf("Accepting client on Inet socket.\n"); establish_client(inet_socket); } + /* Prevent zombie children under Mach */ + wait3(&status,WNOHANG,NULL); } }