diff --git a/sys/i386/apm/apm.c b/sys/i386/apm/apm.c index 4fe3dd287348..827898565e14 100644 --- a/sys/i386/apm/apm.c +++ b/sys/i386/apm/apm.c @@ -15,7 +15,7 @@ * * Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * - * $Id: apm.c,v 1.60 1997/09/21 21:33:10 gibbs Exp $ + * $Id: apm.c,v 1.62 1997/10/23 04:18:49 nate Exp $ */ #include @@ -400,8 +400,11 @@ apm_suspend(void) if (sc->initialized) { apm_execute_hook(hook[APM_HOOK_SUSPEND]); - apm_suspend_system(); - apm_processevent(); + if (apm_suspend_system() == 0) + apm_processevent(); + else + // Failure, 'resume' the system again + apm_execute_hook(hook[APM_HOOK_RESUME]); } } diff --git a/sys/i386/bios/apm.c b/sys/i386/bios/apm.c index 4fe3dd287348..827898565e14 100644 --- a/sys/i386/bios/apm.c +++ b/sys/i386/bios/apm.c @@ -15,7 +15,7 @@ * * Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * - * $Id: apm.c,v 1.60 1997/09/21 21:33:10 gibbs Exp $ + * $Id: apm.c,v 1.62 1997/10/23 04:18:49 nate Exp $ */ #include @@ -400,8 +400,11 @@ apm_suspend(void) if (sc->initialized) { apm_execute_hook(hook[APM_HOOK_SUSPEND]); - apm_suspend_system(); - apm_processevent(); + if (apm_suspend_system() == 0) + apm_processevent(); + else + // Failure, 'resume' the system again + apm_execute_hook(hook[APM_HOOK_RESUME]); } }