diff options
author | 2001-02-06 00:15:01 +0000 | |
---|---|---|
committer | 2001-02-06 00:15:01 +0000 | |
commit | 7aaec015b75e152514078fb040602657910b0d08 (patch) | |
tree | 311e27724036e4ada4b033d5a5e360dffe151631 | |
parent | WSMOUSEIO_SRES, WSMOUSEIO_SSCALE and WSMOUSEIO_SRATE are _IOW(), not _IOR() (diff) | |
download | wireguard-openbsd-7aaec015b75e152514078fb040602657910b0d08.tar.xz wireguard-openbsd-7aaec015b75e152514078fb040602657910b0d08.zip |
only call apm_perror() if get_event() failed
-rw-r--r-- | sys/arch/i386/i386/apm.c | 16 |
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(®s) == 0) - if (apm_handle_event(sc, ®s)) + while (1) { + if (apm_get_event(®s) != 0) { + /* i think some bioses combine the error codes */ + if (!(APM_ERR_CODE(®s) & APM_ERR_NOEVENTS)) + apm_perror("get event", ®s); break; + } - /* i think some bioses actually combine the error codes */ - if (!(APM_ERR_CODE(®s) & APM_ERR_NOEVENTS)) - apm_perror("periodic get event", ®s); + if (apm_handle_event(sc, ®s)) + break; + } if (apm_error || APM_ERR_CODE(®s) == APM_ERR_NOTCONN) ret = -1; |