diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2006-04-15 20:43:37 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2006-04-15 20:43:37 +0000 |
commit | e32839438c4c6941cfed455eec0245ba0418e008 (patch) | |
tree | 55dec6033208a4d27f14d99bdf853c4a69c0251a /sys/arch | |
parent | 71aa1e0febab161c1705df979c783404cc056a2f (diff) |
fail opening apm device if apm is disconnected; deradt ok
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/i386/i386/apm.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/arch/i386/i386/apm.c b/sys/arch/i386/i386/apm.c index ab130a7a2e8..5e8e6637435 100644 --- a/sys/arch/i386/i386/apm.c +++ b/sys/arch/i386/i386/apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apm.c,v 1.67 2005/11/19 02:18:00 pedro Exp $ */ +/* $OpenBSD: apm.c,v 1.68 2006/04/15 20:43:36 mickey Exp $ */ /*- * Copyright (c) 1998-2001 Michael Shalayeff. All rights reserved. @@ -760,6 +760,7 @@ apm_disconnect(sc) apm_perror("disconnect failed", ®s); else printf("%s: disconnected\n", sc->sc_dev.dv_xname); + apm_flags |= APM_BIOS_PM_DISABLED; } int @@ -985,6 +986,9 @@ apmopen(dev, flag, mode, p) !(sc = apm_cd.cd_devs[APMUNIT(dev)])) return ENXIO; + if (apm_flags & APM_BIOS_PM_DISABLED) + return ENXIO; + DPRINTF(("apmopen: dev %d pid %d flag %x mode %x\n", APMDEV(dev), p->p_pid, flag, mode)); |