diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-02-06 00:15:02 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-02-06 00:15:02 +0000 |
commit | a64bc62d54ad86a3b2fa0197206f5e5766d59241 (patch) | |
tree | d344ce639ac979c78ab551cdb89cd7bbbe2d327d | |
parent | 89dfa6867780b9bf05b6e1430441a75acca409cd (diff) |
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; |