When we're preparing to go to sleep, only call bufq_restart() if other
authormatthew <matthew@openbsd.org>
Tue, 20 Jul 2010 04:04:00 +0000 (04:04 +0000)
committermatthew <matthew@openbsd.org>
Tue, 20 Jul 2010 04:04:00 +0000 (04:04 +0000)
preparations failed.

ok kettenis@, thib@, deraadt@

sys/dev/acpi/acpi.c

index fba9d4b..92481a2 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.180 2010/07/19 16:58:12 deraadt Exp $ */
+/* $OpenBSD: acpi.c,v 1.181 2010/07/20 04:04:00 matthew Exp $ */
 /*
  * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
  * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -2272,12 +2272,14 @@ acpi_prepare_sleep_state(struct acpi_softc *sc, int state)
        acpi_susp_resume_gpewalk(sc, state, 1);
 
 fail:
-       bufq_restart();
+       if (error) {
+               bufq_restart();
 
 #if NWSDISPLAY > 0
-       if (error)
                wsdisplay_resume();
 #endif /* NWSDISPLAY > 0 */
+       }
+
        return (error);
 }