From 2a4bd5f4bcc7143d313e9994c5851d976a293e0a Mon Sep 17 00:00:00 2001 From: Tom Cosgrove Date: Thu, 11 Mar 2004 17:41:24 +0000 Subject: 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@ --- sys/arch/i386/stand/libsa/apmprobe.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sys/arch/i386/stand/libsa') 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]", -- cgit v1.2.3