summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhalex <halex@openbsd.org>2012-10-11 22:21:29 +0000
committerhalex <halex@openbsd.org>2012-10-11 22:21:29 +0000
commit1c794bc17639d0a6bd8a8d0bb94261f841d5ae5a (patch)
tree521c692b59997d8ff5b6a44a3dc030ae48e23e7c
parent- if argc / argv not empty after getopt() loop, display usage (diff)
downloadwireguard-openbsd-1c794bc17639d0a6bd8a8d0bb94261f841d5ae5a.tar.xz
wireguard-openbsd-1c794bc17639d0a6bd8a8d0bb94261f841d5ae5a.zip
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) {