diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2000-12-12 00:36:59 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2000-12-12 00:36:59 +0000 |
commit | a581f886ee011d75115ab3fe9f72f0209d6616ac (patch) | |
tree | a682b8b259c889ef2400bd6e198afd34eb171a3c /sys | |
parent | 4d3ce5cfa7beaea48332e0fcedfbefbf12355a2e (diff) |
Add an extra apm_periodic_check() call before the one we check for
errors; that way, Theo's laptop can still turn off APM when there's an
error, and the IBM 770Z won't gratuitously disconnect APM (since the
first event is always a bogus one).
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/i386/i386/apm.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/arch/i386/i386/apm.c b/sys/arch/i386/i386/apm.c index 8cebfbce419..a2c1c070b5c 100644 --- a/sys/arch/i386/i386/apm.c +++ b/sys/arch/i386/i386/apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apm.c,v 1.41 2000/10/18 16:53:01 deraadt Exp $ */ +/* $OpenBSD: apm.c,v 1.42 2000/12/12 00:36:58 angelos Exp $ */ /*- * Copyright (c) 1998-2000 Michael Shalayeff. All rights reserved. @@ -858,6 +858,14 @@ apmattach(parent, self, aux) lockinit(&sc->sc_lock, PWAIT, "apmlk", 0, 0); + /* + * Do a check once, ignoring any errors. This avoids + * gratuitous APM disconnects on laptops where the first + * event in the queue (after a boot) is non-recognizable. + * The IBM ThinkPad 770Z is one of those. + */ + apm_periodic_check(sc); + if (apm_periodic_check(sc) == -1) { apm_disconnect(sc); apm_dobusy = apm_doidle = 0; |