summaryrefslogtreecommitdiffstats
path: root/sbin/init/init.c
diff options
context:
space:
mode:
authornatano <natano@openbsd.org>2017-03-02 10:38:09 +0000
committernatano <natano@openbsd.org>2017-03-02 10:38:09 +0000
commit2d357aeded0106833319c29a54d2bb4b14c40d90 (patch)
tree65a308eef3237aa2a4cbc2d2c3e20c7e67104495 /sbin/init/init.c
parent8168 support jumbo frames; (diff)
downloadwireguard-openbsd-2d357aeded0106833319c29a54d2bb4b14c40d90.tar.xz
wireguard-openbsd-2d357aeded0106833319c29a54d2bb4b14c40d90.zip
Add a new sysctl machdep.lidaction. The sysctl works as follows:
machdep.lidaction=0 # do nothing machdep.lidaction=1 # suspend machdep.lidaction=2 # hibernate lidsuspend is just an alias for lidaction, so if you change one, the other one will have the same value. The plan is to remove machdep.lidsuspend eventually when people have upgraded their /ets/sysctl.conf. discussed with deraadt, who came up with the new MIB name no objections mlarkin ok stsp halex jcs
Diffstat (limited to 'sbin/init/init.c')
-rw-r--r--sbin/init/init.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sbin/init/init.c b/sbin/init/init.c
index 208db53d438..a2dff9bfafa 100644
--- a/sbin/init/init.c
+++ b/sbin/init/init.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init.c,v 1.62 2016/09/05 10:20:40 gsoares Exp $ */
+/* $OpenBSD: init.c,v 1.63 2017/03/02 10:38:09 natano Exp $ */
/* $NetBSD: init.c,v 1.22 1996/05/15 23:29:33 jtc Exp $ */
/*-
@@ -1325,13 +1325,13 @@ f_nice_death(void)
int status;
#ifdef CPU_LIDSUSPEND
- int lidsuspend_mib[] = {CTL_MACHDEP, CPU_LIDSUSPEND};
- int dontsuspend = 0;
+ int mib[] = {CTL_MACHDEP, CPU_LIDACTION};
+ int lidaction = 0;
if ((death_howto & RB_POWERDOWN) &&
- (sysctl(lidsuspend_mib, 2, NULL, NULL, &dontsuspend,
- sizeof(dontsuspend)) == -1) && (errno != EOPNOTSUPP))
- warning("cannot disable lid suspend");
+ (sysctl(mib, 2, NULL, NULL, &lidaction,
+ sizeof(lidaction)) == -1) && (errno != EOPNOTSUPP))
+ warning("cannot disable lid action");
#endif
for (sp = sessions; sp; sp = sp->se_next) {