mirror of
https://github.com/troglobit/finit.git
synced 2026-10-28 12:30:44 +00:00
Write ACPI sleep state to /sys/power/state instead of /proc/acpi/sleep
From http://acpi.sourceforge.net/documentation/sleep.html: /proc/acpi is being replaced by interfaces in /sys and new software should not look in /proc. Users of 2.6 are advised to use the new file in sysfs: /sys/power/state. Metalshark says: February 15th, 2008 at 6:15 am In shutdown you use “/proc/acpi/sleep”, would it be advisable to use the new sysfs method and use that if available and if not use proc (at runtime) with compile time options to disable proc/sysfs methods? Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
This commit is contained in:
1 parent
bbe281db55
commit
9a2b6890e5
3 files changed
+5
-2
No files matched your search
+1
-1
@@ -373,7 +373,7 @@ void shutdown(int sig)
|
||||
if (sig == SIGINT || sig == SIGUSR1)
|
||||
reboot(RB_AUTOBOOT);
|
||||
|
||||
if ((fd = open("/proc/acpi/sleep", O_WRONLY)) >= 0) {
|
||||
if ((fd = open("/sys/power/state", O_WRONLY)) >= 0) {
|
||||
write(fd, "5", 1);
|
||||
close(fd);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user