summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2016-05-11 09:30:18 +0000
committertrasz <trasz@FreeBSD.org>2016-05-11 09:30:18 +0000
commitfbdb745d9035c812ff84d171fe0814de17229b54 (patch)
tree6fc66abba6e0d859a41893011d188a29cb8d8221 /sbin
parentc4a0add2d75487174727553265cdfd705a10ee96 (diff)
downloadFreeBSD-src-fbdb745d9035c812ff84d171fe0814de17229b54.zip
FreeBSD-src-fbdb745d9035c812ff84d171fe0814de17229b54.tar.gz
When rerooting, ignore ESRCH returned from kill(2). I couldn't reproduce
this by myself, but apparently it sometimes happens when rerooting from single user mode. Reported by: jilles@ MFC after: 1 month Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sbin')
-rw-r--r--sbin/init/init.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sbin/init/init.c b/sbin/init/init.c
index 0070990..7355a53 100644
--- a/sbin/init/init.c
+++ b/sbin/init/init.c
@@ -779,9 +779,11 @@ reroot(void)
/*
* Make sure nobody can interfere with our scheme.
+ * Ignore ESRCH, which can apparently happen when
+ * there are no processes to kill.
*/
error = kill(-1, SIGKILL);
- if (error != 0) {
+ if (error != 0 && errno != ESRCH) {
emergency("kill(2) failed: %s", strerror(errno));
goto out;
}
OpenPOWER on IntegriCloud