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;
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to