From fbdb745d9035c812ff84d171fe0814de17229b54 Mon Sep 17 00:00:00 2001 From: trasz Date: Wed, 11 May 2016 09:30:18 +0000 Subject: 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 --- sbin/init/init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sbin') 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; } -- cgit v1.1