X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/blobdiff_plain/554776b160abf316c6a8b3590be4253a449643cf..beebc37948c4baf100fd1fc11c2310d6094403be:/server/mr_main.c diff --git a/server/mr_main.c b/server/mr_main.c index 09c09b38..9e61f243 100644 --- a/server/mr_main.c +++ b/server/mr_main.c @@ -4,7 +4,8 @@ * $Header$ * * Copyright (C) 1987 by the Massachusetts Institute of Technology - * + * For copying and distribution information, please see the file + * . * * SMS server process. * @@ -17,6 +18,7 @@ static char *rcsid_sms_main_c = "$Header$"; +#include #include #include #include @@ -127,6 +129,7 @@ main(argc, argv) */ if ((((int)signal (SIGTERM, sigshut)) < 0) || + (((int)signal (SIGCHLD, reapchild)) < 0) || (((int)signal (SIGHUP, sigshut)) < 0)) { com_err(whoami, errno, " Unable to establish signal handler."); exit(1); @@ -285,7 +288,6 @@ new_connection() */ cp = (client *)malloc(sizeof *cp); bzero(cp, sizeof(*cp)); - cp->state = CL_STARTING; cp->action = CL_ACCEPT; cp->con = newconn; cp->id = counter++; @@ -439,6 +441,8 @@ void reapchild() union wait status; int pid; + if (takedown) + return; while ((pid = wait3(&status, WNOHANG, (struct rusage *)0)) > 0) { if (status.w_termsig == 0 && status.w_retcode == 0) com_err(whoami, 0, "dcm started successfully");