diff options
author | Simon J. Gerraty <sjg@FreeBSD.org> | 2012-11-04 02:52:03 +0000 |
---|---|---|
committer | Simon J. Gerraty <sjg@FreeBSD.org> | 2012-11-04 02:52:03 +0000 |
commit | 23090366f729c56cab62de74c7a51792357e98a9 (patch) | |
tree | c511c885796e28ec571b5267e8f11f3b103d35e9 /usr.sbin/daemon | |
parent | 7750ad47a9a7dbc83f87158464170c8640723293 (diff) | |
parent | 22ff74b2f44234d31540b1f7fd6c91489c37cad3 (diff) | |
download | src-23090366f729c56cab62de74c7a51792357e98a9.tar.gz src-23090366f729c56cab62de74c7a51792357e98a9.zip |
Sync from head
Notes
Notes:
svn path=/projects/bmake/; revision=242545
Diffstat (limited to 'usr.sbin/daemon')
-rw-r--r-- | usr.sbin/daemon/daemon.8 | 4 | ||||
-rw-r--r-- | usr.sbin/daemon/daemon.c | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/daemon/daemon.8 b/usr.sbin/daemon/daemon.8 index 2f9cb6b761db..14b134af6638 100644 --- a/usr.sbin/daemon/daemon.8 +++ b/usr.sbin/daemon/daemon.8 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 19, 2012 +.Dd June 4, 2012 .Dt DAEMON 8 .Os .Sh NAME @@ -34,7 +34,7 @@ .Nd run detached from the controlling terminal .Sh SYNOPSIS .Nm -.Op Fl cf +.Op Fl cfr .Op Fl p Ar pidfile .Op Fl u Ar user .Ar command arguments ... diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index 54d312358617..7c8e9feeba71 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -217,6 +217,10 @@ wait_child(pid_t pid, sigset_t *mask) } switch (signo) { case SIGCHLD: + if (waitpid(pid, NULL, WNOHANG) == -1) { + warn("waitpid"); + return (-1); + } return (terminate); case SIGTERM: terminate = 1; @@ -236,7 +240,7 @@ static void usage(void) { (void)fprintf(stderr, - "usage: daemon [-cf] [-p pidfile] [-u user] command " + "usage: daemon [-cfr] [-p pidfile] [-u user] command " "arguments ...\n"); exit(1); } |