From 0c26519e5ae6d6a7518c0c17ea50e7da1c361b85 Mon Sep 17 00:00:00 2001 From: Mitsuru IWASAKI Date: Sun, 27 Jan 2008 16:11:04 +0000 Subject: [PATCH] Enter the sleep state immediately without waiting for timeout if devd(8) is not running such as the system in single user mode. MFC after: 1 week --- sys/dev/acpica/acpi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index cc35e2c59dab..4bd564accced 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -2195,6 +2195,12 @@ acpi_ReqSleepState(struct acpi_softc *sc, int state) } } + /* If devd(8) is not running, immediately enter the sleep state. */ + if (devctl_process_running() == FALSE) { + ACPI_UNLOCK(acpi); + return (ACPI_FAILURE(acpi_EnterSleepState(sc, sc->acpi_next_sstate))); + } + /* Now notify devd(8) also. */ acpi_UserNotify("Suspend", ACPI_ROOT_OBJECT, state);