summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2006-02-06 10:12:00 +0000
committerjeff <jeff@FreeBSD.org>2006-02-06 10:12:00 +0000
commit2f3a978b92227c86d7e01c9b73037a9508d770c6 (patch)
treea3fa63130af424c8a1c14bf0150ae5d9a842dc50
parenteeadb385e22b29584783a991d77eff0902110d77 (diff)
downloadFreeBSD-src-2f3a978b92227c86d7e01c9b73037a9508d770c6.zip
FreeBSD-src-2f3a978b92227c86d7e01c9b73037a9508d770c6.tar.gz
- Add the global 'rebooting' variable that is used to detect when
boot() has been called. Sponsored by: Isilon Systems, Inc. MFC After: 1 week
-rw-r--r--sys/kern/kern_shutdown.c3
-rw-r--r--sys/sys/systm.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c
index 9ba486f..da7abbc 100644
--- a/sys/kern/kern_shutdown.c
+++ b/sys/kern/kern_shutdown.c
@@ -111,6 +111,7 @@ SYSCTL_NODE(_kern, OID_AUTO, shutdown, CTLFLAG_RW, 0, "Shutdown environment");
const char *panicstr;
int dumping; /* system is dumping */
+int rebooting; /* system is rebooting */
static struct dumperinfo dumper; /* our selected dumper */
/* Context information for dump-debuggers. */
@@ -265,6 +266,8 @@ boot(int howto)
mtx_unlock_spin(&sched_lock);
KASSERT(PCPU_GET(cpuid) == 0, ("boot: not running on cpu 0"));
#endif
+ /* We're in the process of rebooting. */
+ rebooting = 1;
/* collect extra flags that shutdown_nice might have set */
howto |= shutdown_howto;
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index 80ec09d..235e8dd 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -49,6 +49,7 @@ extern int securelevel; /* system security level (see init(8)) */
extern int suser_enabled; /* suser() is permitted to return 0 */
extern int cold; /* nonzero if we are doing a cold boot */
+extern int rebooting; /* boot() has been called. */
extern const char *panicstr; /* panic message */
extern char version[]; /* system version */
extern char copyright[]; /* system copyright */
OpenPOWER on IntegriCloud