mirror of
https://github.com/troglobit/finit.git
synced 2026-10-15 10:29:35 +00:00
Replace reboot(RB_SW_SUSPEND) w/ internal /sys/power/state API
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
01cb088e51
commit
bd9bb92ca0
4 files changed
+42
-4
No files matched your search
+4
-2
@@ -160,6 +160,8 @@ int reboot_main(int argc, char *argv[])
|
||||
transform(NULL);
|
||||
|
||||
if (force) {
|
||||
sync();
|
||||
|
||||
switch (cmd) {
|
||||
case CMD_REBOOT:
|
||||
c = reboot(RB_AUTOBOOT);
|
||||
@@ -174,9 +176,9 @@ int reboot_main(int argc, char *argv[])
|
||||
break;
|
||||
|
||||
case CMD_SUSPEND:
|
||||
c = reboot(RB_SW_SUSPEND);
|
||||
c = suspend();
|
||||
if (c && errno == EINVAL)
|
||||
errx(1, "Kernel does not support suspend.");
|
||||
errx(1, "Kernel does not support suspend to RAM.");
|
||||
break;
|
||||
|
||||
case CMD_UNKNOWN:
|
||||
|
||||
Reference in new issue
Block a user