fix reboot panic.
authormickey <mickey@openbsd.org>
Wed, 8 May 1996 01:26:32 +0000 (01:26 +0000)
committermickey <mickey@openbsd.org>
Wed, 8 May 1996 01:26:32 +0000 (01:26 +0000)
sys/arch/alpha/alpha/machdep.c
sys/arch/amiga/amiga/machdep.c

index 1959c82..c15255c 100644 (file)
@@ -770,6 +770,12 @@ boot(howto)
 
        boothowto = howto;
        if ((howto & RB_NOSYNC) == 0 && waittime < 0) {
+               extern struct proc proc0;
+
+               /* protect against curproc->p_stats.foo refs in sync   XXX */
+               if (curproc == NULL)
+                       curproc = &proc0;
+
                waittime = 0;
                vfs_shutdown();
                /*
index 4b3d0fc..09ef853 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: machdep.c,v 1.9 1996/05/04 13:38:33 niklas Exp $      */
+/*     $OpenBSD: machdep.c,v 1.10 1996/05/08 01:30:40 mickey Exp $     */
 /*     $NetBSD: machdep.c,v 1.65 1996/05/01 09:56:22 veego Exp $       */
 
 /*
@@ -977,8 +977,13 @@ bootsync(void)
                /*
                 * unmount filesystems
                 */
-               if (panicstr == 0)
+               if (panicstr == 0) {
+                       extern struct proc proc0;
+                       if (curproc == NULL)
+                               curproc = &proc0;
+
                        vfs_unmountall();
+               }
 
                for (iter = 0; iter < 20; iter++) {
                        nbusy = 0;