Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 May 2016 09:30:19 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r299417 - head/sbin/init
Message-ID:  <201605110930.u4B9UJUp096318@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605110930.u4B9UJUp096318>