summaryrefslogtreecommitdiff
path: root/sys/arch/i386/stand/libsa/apmprobe.c
diff options
context:
space:
mode:
authorTom Cosgrove <tom@cvs.openbsd.org>2004-03-11 17:41:24 +0000
committerTom Cosgrove <tom@cvs.openbsd.org>2004-03-11 17:41:24 +0000
commit2a4bd5f4bcc7143d313e9994c5851d976a293e0a (patch)
tree489b4eb4ad57a3a415a80e2e10039eaac8048af7 /sys/arch/i386/stand/libsa/apmprobe.c
parent7807c698278e9aa141d8aedf4d4d7b7dc755145a (diff)
If apm_connect() fails, don't try to pass the bios_apminfo_t structure
to the kernel, since it won't have been filled in, and since we can't make APM calls if we don't connect (per spec). Also tidy up the error message, to make it clear that it's an APM error. Problem found, and fix tested, by jmc@ ok millert@, weingart@
Diffstat (limited to 'sys/arch/i386/stand/libsa/apmprobe.c')
-rw-r--r--sys/arch/i386/stand/libsa/apmprobe.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/arch/i386/stand/libsa/apmprobe.c b/sys/arch/i386/stand/libsa/apmprobe.c
index 5069d081d5d..8c4a4aa0b4e 100644
--- a/sys/arch/i386/stand/libsa/apmprobe.c
+++ b/sys/arch/i386/stand/libsa/apmprobe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apmprobe.c,v 1.12 2004/03/09 19:12:12 tom Exp $ */
+/* $OpenBSD: apmprobe.c,v 1.13 2004/03/11 17:41:23 tom Exp $ */
/*
* Copyright (c) 1997-2000 Michael Shalayeff
@@ -166,8 +166,10 @@ apmprobe(void)
apm_disconnect();
- if (apm_connect(&ai) != 0)
- printf(": connect error\n");
+ if (apm_connect(&ai) != 0) {
+ printf("\napm: connect error\n");
+ return;
+ }
#ifdef DEBUG
if (debug)
printf("apm[%x cs=%x[%x]/%x[%x] ds=%x[%x] @ %x]",