Subject: pkg/15577: gkrellm apm driver doesn't always work
To: None <gnats-bugs@gnats.netbsd.org>
From: Johan Danielsson <joda@pdc.kth.se>
List: netbsd-bugs
Date: 02/11/2002 10:36:51
>Number:         15577
>Category:       pkg
>Synopsis:       gkrellm apm driver doesn't always work
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 11 01:37:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Johan Danielsson
>Release:        NetBSD 1.5ZA
>Organization:
	<organization of PR author (multiple lines)>
>Environment:
System: NetBSD blubb.pdc.kth.se 1.5ZA NetBSD 1.5ZA (BLUBB) #401: Tue Jan 22 11:29:10 CET 2002 joda@blubb.pdc.kth.se:/usr/misc/src/netbsd/netbsd-cvs/src/sys/arch/i386/compile/BLUBB i386
Architecture: i386
Machine: i386
>Description:

The apm_power_info structure has to zeroed, otherwise you get info for
random batteries (that may not exist).

>How-To-Repeat:
>Fix:
--- work/gkrellm-1.2.4/src/apm.c~       Mon Oct 22 05:26:05 2001
+++ work/gkrellm-1.2.4/src/apm.c        Mon Feb 11 10:16:52 2002
@@ -145,6 +145,7 @@
    struct apm_power_info info;
 
    if ((f = open(APMDEV, O_RDONLY)) == -1) return;
+   memset(&info, 0, sizeof(info));
    r = ioctl(f, APM_IOC_GETPOWER, &info);
    close(f);
    if (r == -1) return;
>Release-Note:
>Audit-Trail:
>Unformatted: