summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2003-04-02 22:13:56 +0000
committerrwatson <rwatson@FreeBSD.org>2003-04-02 22:13:56 +0000
commit3997bed507397508c7f8fa7197c35286598a5170 (patch)
tree0a334b4c337f551d83060683756e0aed105bc73e
parentc0b4f0941651216866b58fd606374f0c651fa082 (diff)
downloadFreeBSD-src-3997bed507397508c7f8fa7197c35286598a5170.zip
FreeBSD-src-3997bed507397508c7f8fa7197c35286598a5170.tar.gz
When kill(-1) returns ESRCH, it could be because the current process
doesn't have a process group, which can occur if you're working with a custom init that doesn't set up a full tty context. Rather than refusing to reboot, ignore ESRCH from the kill attempt in reboot(8).
-rw-r--r--sbin/reboot/reboot.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/reboot/reboot.c b/sbin/reboot/reboot.c
index b30582d..09f52fd 100644
--- a/sbin/reboot/reboot.c
+++ b/sbin/reboot/reboot.c
@@ -164,7 +164,7 @@ main(int argc, char *argv[])
(void)signal(SIGHUP, SIG_IGN);
/* Send a SIGTERM first, a chance to save the buffers. */
- if (kill(-1, SIGTERM) == -1)
+ if (kill(-1, SIGTERM) == -1 && errno != ESRCH)
err(1, "SIGTERM processes");
/*
OpenPOWER on IntegriCloud