diff options
author | Darren Tucker <dtucker@cvs.openbsd.org> | 2005-07-11 08:08:07 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@cvs.openbsd.org> | 2005-07-11 08:08:07 +0000 |
commit | 98ce8ad0ad6e757aadf205818c20c7ae8c83ed6e (patch) | |
tree | 6ea03399570c2199be468e8877886752cf2ea830 /usr.sbin/ntpd | |
parent | ff8eafeb9b41008615e1335038d0be885d48893a (diff) |
More descriptive error if a signal causes the child to exit; ok henning@
Diffstat (limited to 'usr.sbin/ntpd')
-rw-r--r-- | usr.sbin/ntpd/ntpd.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/ntpd/ntpd.c b/usr.sbin/ntpd/ntpd.c index a46918b2d1b..bf384bb7a7d 100644 --- a/usr.sbin/ntpd/ntpd.c +++ b/usr.sbin/ntpd/ntpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntpd.c,v 1.38 2005/06/19 17:11:13 henning Exp $ */ +/* $OpenBSD: ntpd.c,v 1.39 2005/07/11 08:08:06 dtucker Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -217,7 +217,8 @@ main(int argc, char *argv[]) int check_child(pid_t pid, const char *pname) { - int status; + int status, sig; + char *signame; if (waitpid(pid, &status, WNOHANG) > 0) { if (WIFEXITED(status)) { @@ -225,8 +226,10 @@ check_child(pid_t pid, const char *pname) return (1); } if (WIFSIGNALED(status)) { - log_warnx("Lost child: %s terminated; signal %d", - pname, WTERMSIG(status)); + sig = WTERMSIG(status); + signame = strsignal(sig) ? strsignal(sig) : "unknown"; + log_warnx("Lost child: %s terminated; signal %d (%s)", + pname, sig, signame); return (1); } } |