diff options
author | gshapiro <gshapiro@FreeBSD.org> | 2004-02-14 21:53:31 +0000 |
---|---|---|
committer | gshapiro <gshapiro@FreeBSD.org> | 2004-02-14 21:53:31 +0000 |
commit | 3b5debc668e4cf70a893a0e38111db42ea9ecd45 (patch) | |
tree | 621e7318cf8faf4eacb777dd294461b080ec5c75 /contrib/sendmail/src/main.c | |
parent | 1b4c430a4d3cf1880aead276da9d85ddec2aecdb (diff) | |
parent | 238623a0204c90e8d61dbde7b3b499a5036f2e5d (diff) | |
download | FreeBSD-src-3b5debc668e4cf70a893a0e38111db42ea9ecd45.zip FreeBSD-src-3b5debc668e4cf70a893a0e38111db42ea9ecd45.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r125820,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/sendmail/src/main.c')
-rw-r--r-- | contrib/sendmail/src/main.c | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/contrib/sendmail/src/main.c b/contrib/sendmail/src/main.c index a56315c..0d8c0ce 100644 --- a/contrib/sendmail/src/main.c +++ b/contrib/sendmail/src/main.c @@ -25,7 +25,7 @@ SM_UNUSED(static char copyright[]) = The Regents of the University of California. All rights reserved.\n"; #endif /* ! lint */ -SM_RCSID("@(#)$Id: main.c,v 8.887.2.27 2003/08/04 17:23:37 ca Exp $") +SM_RCSID("@(#)$Id: main.c,v 8.887.2.29 2003/11/07 00:09:31 ca Exp $") #if NETINET || NETINET6 @@ -2234,8 +2234,32 @@ main(argc, argv, envp) int status; pid_t ret; + errno = 0; while ((ret = sm_wait(&status)) <= 0) + { + if (errno == ECHILD) + { + /* + ** Oops... something got messed + ** up really bad. Waiting for + ** non-existent children + ** shouldn't happen. Let's get + ** out of here. + */ + + CurChildren = 0; + break; + } continue; + } + + /* something is really really wrong */ + if (errno == ECHILD) + { + sm_syslog(LOG_ERR, NOQID, + "queue control process: lost all children: wait returned ECHILD"); + break; + } /* Only drop when a child gives status */ if (WIFSTOPPED(status)) @@ -2371,8 +2395,31 @@ main(argc, argv, envp) int group; CHECK_RESTART; + errno = 0; while ((ret = sm_wait(&status)) <= 0) + { + /* + ** Waiting for non-existent + ** children shouldn't happen. + ** Let's get out of here if + ** it occurs. + */ + + if (errno == ECHILD) + { + CurChildren = 0; + break; + } continue; + } + + /* something is really really wrong */ + if (errno == ECHILD) + { + sm_syslog(LOG_ERR, NOQID, + "persistent queue runner control process: lost all children: wait returned ECHILD"); + break; + } if (WIFSTOPPED(status)) continue; |