From a581f886ee011d75115ab3fe9f72f0209d6616ac Mon Sep 17 00:00:00 2001 From: "Angelos D. Keromytis" Date: Tue, 12 Dec 2000 00:36:59 +0000 Subject: 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). --- sys/arch/i386/i386/apm.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sys') 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; -- cgit v1.2.3