summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormickey <mickey@openbsd.org>2001-02-06 00:15:01 +0000
committermickey <mickey@openbsd.org>2001-02-06 00:15:01 +0000
commit7aaec015b75e152514078fb040602657910b0d08 (patch)
tree311e27724036e4ada4b033d5a5e360dffe151631
parentWSMOUSEIO_SRES, WSMOUSEIO_SSCALE and WSMOUSEIO_SRATE are _IOW(), not _IOR() (diff)
downloadwireguard-openbsd-7aaec015b75e152514078fb040602657910b0d08.tar.xz
wireguard-openbsd-7aaec015b75e152514078fb040602657910b0d08.zip
only call apm_perror() if get_event() failed
-rw-r--r--sys/arch/i386/i386/apm.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/arch/i386/i386/apm.c b/sys/arch/i386/i386/apm.c
index c9f0637ee9a..f04b18ca834 100644
--- a/sys/arch/i386/i386/apm.c
+++ b/sys/arch/i386/i386/apm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apm.c,v 1.43 2001/01/02 16:16:50 mickey Exp $ */
+/* $OpenBSD: apm.c,v 1.44 2001/02/06 00:15:01 mickey Exp $ */
/*-
* Copyright (c) 1998-2000 Michael Shalayeff. All rights reserved.
@@ -525,13 +525,17 @@ apm_periodic_check(sc)
if (apm_op_inprog)
apm_set_powstate(APM_DEV_ALLDEVS, APM_LASTREQ_INPROG);
- while (apm_get_event(&regs) == 0)
- if (apm_handle_event(sc, &regs))
+ while (1) {
+ if (apm_get_event(&regs) != 0) {
+ /* i think some bioses combine the error codes */
+ if (!(APM_ERR_CODE(&regs) & APM_ERR_NOEVENTS))
+ apm_perror("get event", &regs);
break;
+ }
- /* i think some bioses actually combine the error codes */
- if (!(APM_ERR_CODE(&regs) & APM_ERR_NOEVENTS))
- apm_perror("periodic get event", &regs);
+ if (apm_handle_event(sc, &regs))
+ break;
+ }
if (apm_error || APM_ERR_CODE(&regs) == APM_ERR_NOTCONN)
ret = -1;