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
2022-04-16 23:59:32 +02:00
parent 01cb088e51
commit bd9bb92ca0
4 changed files with 42 additions and 4 deletions
+2 -2
View File
@@ -250,10 +250,10 @@ static int do_reboot(int cmd, char *buf, size_t len)
case INIT_CMD_SUSPEND:
_d("suspend");
sync();
rc = reboot(RB_SW_SUSPEND);
rc = sys_suspend();
if (rc) {
if (errno == EINVAL)
snprintf(buf, len, "Kernel does not support suspend.");
snprintf(buf, len, "Kernel does not support suspend to RAM.");
else
snprintf(buf, len, "Failed: %s", strerror(errno));
}