summaryrefslogtreecommitdiffstats
path: root/usr.sbin/inetd/inetd.c
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2002-09-04 21:00:45 +0000
committerdwmalone <dwmalone@FreeBSD.org>2002-09-04 21:00:45 +0000
commit31656d5090302f29415b0e07edf932feab5d7de2 (patch)
treece7ea74cff8234ceca9eadcd6671076241a661ef /usr.sbin/inetd/inetd.c
parenta8ad3be6d583d69ffbaf65535072e91df5337a0f (diff)
downloadFreeBSD-src-31656d5090302f29415b0e07edf932feab5d7de2.zip
FreeBSD-src-31656d5090302f29415b0e07edf932feab5d7de2.tar.gz
When printing the wait status, break it down into a signal and a exit status.
PR: 41912 Submitted by: Aaron Smith <aaron@mutex.org> MFC after: 2 weeks
Diffstat (limited to 'usr.sbin/inetd/inetd.c')
-rw-r--r--usr.sbin/inetd/inetd.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c
index ad779a9..aed7e58 100644
--- a/usr.sbin/inetd/inetd.c
+++ b/usr.sbin/inetd/inetd.c
@@ -917,7 +917,10 @@ reapchild(void)
if (pid <= 0)
break;
if (debug)
- warnx("%d reaped, status %#x", pid, status);
+ warnx("%d reaped, %s %u", pid,
+ WIFEXITED(status) ? "status" : "signal",
+ WIFEXITED(status) ? WEXITSTATUS(status)
+ : WTERMSIG(status));
for (sep = servtab; sep; sep = sep->se_next) {
for (k = 0; k < sep->se_numchild; k++)
if (sep->se_pids[k] == pid)
@@ -927,10 +930,13 @@ reapchild(void)
if (sep->se_numchild == sep->se_maxchild)
enable(sep);
sep->se_pids[k] = sep->se_pids[--sep->se_numchild];
- if (status)
+ if (WIFSIGNALED(status) || WEXITSTATUS(status))
syslog(LOG_WARNING,
- "%s[%d]: exit status 0x%x",
- sep->se_server, pid, status);
+ "%s[%d]: exited, %s %u",
+ sep->se_server, pid,
+ WIFEXITED(status) ? "status" : "signal",
+ WIFEXITED(status) ? WEXITSTATUS(status)
+ : WTERMSIG(status));
break;
}
reapchild_conn(pid);
OpenPOWER on IntegriCloud