svn commit: r299417 - head/sbin/init

Edward Tomasz Napierala trasz at FreeBSD.org
Wed May 11 09:30:20 UTC 2016


Author: trasz
Date: Wed May 11 09:30:18 2016
New Revision: 299417
URL: https://svnweb.freebsd.org/changeset/base/299417

Log:
  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

Modified:
  head/sbin/init/init.c

Modified: head/sbin/init/init.c
==============================================================================
--- head/sbin/init/init.c	Wed May 11 09:26:23 2016	(r299416)
+++ head/sbin/init/init.c	Wed May 11 09:30:18 2016	(r299417)
@@ -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;
 	}


More information about the svn-src-head mailing list