Module Name: src
Committed By: jym
Date: Sat Sep 17 14:44:18 UTC 2011
Modified Files:
src/etc/powerd/scripts: sleep_button
Log Message:
- use -q to test for presence of a sysctl(7) variable silently
- modify powerd(8) sleep_button script so it can handle the soon-to-be
Xen suspend command.
To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/etc/powerd/scripts/sleep_button
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/etc/powerd/scripts/sleep_button
diff -u src/etc/powerd/scripts/sleep_button:1.8 src/etc/powerd/scripts/sleep_button:1.9
--- src/etc/powerd/scripts/sleep_button:1.8 Fri May 27 09:28:42 2011
+++ src/etc/powerd/scripts/sleep_button Sat Sep 17 14:44:18 2011
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $NetBSD: sleep_button,v 1.8 2011/05/27 09:28:42 plunky Exp $
+# $NetBSD: sleep_button,v 1.9 2011/09/17 14:44:18 jym Exp $
#
# Generic script for sleep button events.
#
@@ -17,8 +17,10 @@
/etc/rc.d/network stop
/etc/rc.d/wpa_supplicant stop
- if /sbin/sysctl hw.acpi.sleep.state >/dev/null 2>&1; then
+ if /sbin/sysctl -q hw.acpi.sleep.state; then
/sbin/sysctl -w hw.acpi.sleep.state=3
+ elif /sbin/sysctl -q machdep.xen.suspend; then
+ /sbin/sysctl -w machdep.xen.suspend=1
else
sleep 1
if /etc/rc.d/apmd onestatus >/dev/null ; then