diff options
author | 1997-01-02 12:24:35 +0000 | |
---|---|---|
committer | 1997-01-02 12:24:35 +0000 | |
commit | 7df4515d109e2e565266a9f6230d04d1f34bf1a5 (patch) | |
tree | 4df4083ce0b3b803152c676b338e9657246d73da | |
parent | pulled out the duplicated, conditional code from both kern/vfs_syscalls.c (diff) | |
download | wireguard-openbsd-7df4515d109e2e565266a9f6230d04d1f34bf1a5.tar.xz wireguard-openbsd-7df4515d109e2e565266a9f6230d04d1f34bf1a5.zip |
prevent system from suspend/standby twice.
(netbsd pr#3005, yasufu-i@is.aist-nara.ac.jp)
-rw-r--r-- | sys/arch/i386/i386/apm.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/arch/i386/i386/apm.c b/sys/arch/i386/i386/apm.c index 95449489315..bbf0ee32bb8 100644 --- a/sys/arch/i386/i386/apm.c +++ b/sys/arch/i386/i386/apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apm.c,v 1.3 1996/10/21 11:37:53 mickey Exp $ */ +/* $OpenBSD: apm.c,v 1.4 1997/01/02 12:24:35 mickey Exp $ */ /*- * Copyright (c) 1995 John T. Kohl. All rights reserved. @@ -311,8 +311,8 @@ struct apmregs *regs; case APM_USER_STANDBY_REQ: DPRINTF(("user wants STANDBY--fat chance\n")); (void) apm_set_powstate(APM_DEV_ALLDEVS, APM_LASTREQ_REJECTED); - (void) apm_record_event(sc, regs->bx); - apm_userstandbys++; + if (apm_record_event(sc, regs->bx)) + apm_userstandbys++; break; case APM_STANDBY_REQ: DPRINTF(("standby requested\n")); @@ -330,8 +330,8 @@ struct apmregs *regs; DPRINTF(("user wants suspend--fat chance!\n")); (void) apm_set_powstate(APM_DEV_ALLDEVS, APM_LASTREQ_REJECTED); - apm_suspends++; - apm_record_event(sc, regs->bx); + if (apm_record_event(sc, regs->bx)) + apm_suspends++; break; case APM_SUSPEND_REQ: DPRINTF(("suspend requested\n")); |