Replace reboot(RB_SW_SUSPEND) w/ internal /sys/power/state API

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2022-04-16 23:59:32 +02:00
1 parent 01cb088e51
commit bd9bb92ca0
4 files changed
+42 -4

No files matched your search

+4 -2
View File
@@ -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: