Subject: pkg/14553: xbatt doesn't handle 'new' apm
To: None <gnats-bugs@gnats.netbsd.org>
From: None <lha@stacken.kth.se>
List: netbsd-bugs
Date: 11/12/2001 13:20:18
>Number:         14553
>Category:       pkg
>Synopsis:       xbatt doesn't handle 'new' apm
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 12 04:21:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Love
>Release:        NetBSD 1.5Y
>Organization:
	Stacken Computer Club
>Environment:
System: NetBSD nutcracker.stacken.kth.se 1.5Y NetBSD 1.5Y (NUTCRACKER) #0: Thu Nov 8 10:01:57 CET 2001 lha@nutcracker.stacken.kth.se:/usr/src/sys/arch/i386/compile/NUTCRACKER i386
Architecture: i386
Machine: i386
>Description:
	
	See pkg/14550

>How-To-Repeat:

	Build and run xbatt.

>Fix:

I've sent mail to the maintainer.

: lha@nutcracker ; pwd
/usr/pkgsrc/sysutils/xbatt
: lha@nutcracker ; cvs diff 
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/sysutils/xbatt/distinfo,v
retrieving revision 1.2
diff -w -u -r1.2 distinfo
--- distinfo    2001/04/19 11:29:11     1.2
+++ distinfo    2001/11/12 12:01:58
@@ -3,4 +3,4 @@
 SHA1 (xbatt-1.3pr1.tar.gz) = dc6a8624c134d9e4262ea87640d3eda028973bcf
 Size (xbatt-1.3pr1.tar.gz) = 14412 bytes
 SHA1 (patch-aa) = b822b75668a3494a72b496d820b67720b732add4
-SHA1 (patch-ab) = 216fe440e6600c8de38171cc478ea029feb2ae19
+SHA1 (patch-ab) = 82abd1ac5f75c4434e6240ddd347dc6b3dcf2fe7
Index: patches/patch-ab
===================================================================
RCS file: /cvsroot/pkgsrc/sysutils/xbatt/patches/patch-ab,v
retrieving revision 1.1
diff -w -u -r1.1 patch-ab
--- patch-ab    1999/12/10 09:13:59     1.1
+++ patch-ab    2001/11/12 12:01:58
@@ -1,7 +1,7 @@
 $NetBSD: patch-ab,v 1.1 1999/12/10 09:13:59 itohy Exp $
 
---- xbatt.c.orig       Fri Sep 18 21:03:05 1998
-+++ xbatt.c    Fri Dec 10 07:48:25 1999
+--- xbatt.c.orig       Fri Sep 18 14:03:05 1998
++++ xbatt.c    Mon Nov 12 12:55:03 2001
 @@ -219,6 +219,7 @@
  String fallback_resouces[] = {
      "*width: 39",
@@ -10,3 +10,11 @@
  };
  
  main(
+@@ -494,6 +495,7 @@
+ 
+ #ifdef __NetBSD__
+     struct apm_power_info info;
++    memset(&info, 0, sizeof(info));
+     if( ioctl(apmfd, APM_IOC_GETPOWER, &info) == -1 ) {
+       fprintf(stderr, "xbatt: ioctl APM_IOC_GETPOWER failed\n");
+       exit(1);

>Release-Note:
>Audit-Trail:
>Unformatted: