summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Hall <halex@cvs.openbsd.org>2012-10-11 22:21:30 +0000
committerAlexander Hall <halex@cvs.openbsd.org>2012-10-11 22:21:30 +0000
commit843db7a8c30d575ac8db12fcd6a07599e3517056 (patch)
tree16c6e157f244595f1f57f512b73127c9f276c3f9
parent1c025622a4236c06954ef9c355cc696da842b4d9 (diff)
fix "disable lidsuspend on shutdown":
- pull in machine/cpu.h so we can actually see CPU_LIDSUSPEND if it's there - fix the resulting compilation errors now that the code is actually used "Just go for it" deraadt@
-rw-r--r--sbin/init/init.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/init/init.c b/sbin/init/init.c
index 9dedc0668ab..189ff2a2d0f 100644
--- a/sbin/init/init.c
+++ b/sbin/init/init.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init.c,v 1.46 2012/04/06 17:25:00 deraadt Exp $ */
+/* $OpenBSD: init.c,v 1.47 2012/10/11 22:21:29 halex Exp $ */
/* $NetBSD: init.c,v 1.22 1996/05/15 23:29:33 jtc Exp $ */
/*-
@@ -37,6 +37,7 @@
#include <sys/sysctl.h>
#include <sys/wait.h>
#include <sys/reboot.h>
+#include <machine/cpu.h>
#include <db.h>
#include <err.h>
@@ -1313,7 +1314,7 @@ nice_death(void)
static const int death_sigs[3] = { SIGHUP, SIGTERM, SIGKILL };
int status;
-#if CPU_LIDSUSPEND
+#ifdef CPU_LIDSUSPEND
int lidsuspend_mib[] = {CTL_MACHDEP, CPU_LIDSUSPEND};
int dontsuspend = 0;
@@ -1321,7 +1322,6 @@ nice_death(void)
(sysctl(lidsuspend_mib, 2, NULL, NULL, &dontsuspend,
sizeof(dontsuspend)) < 0))
warning("cannot disable lid suspend");
- }
#endif
for (sp = sessions; sp; sp = sp->se_next) {