From 7718f45c22a0c9ca04fa4f4a9e94509a4b4e7324 Mon Sep 17 00:00:00 2001 From: David Malone Date: Wed, 4 Sep 2002 21:00:45 +0000 Subject: [PATCH] When printing the wait status, break it down into a signal and a exit status. PR: 41912 Submitted by: Aaron Smith MFC after: 2 weeks --- usr.sbin/inetd/inetd.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c index ad779a96c731..aed7e58c8884 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);