Subject: bin/5787: apmd is obnoxiously verbose
To: None <gnats-bugs@gnats.netbsd.org>
From: None <danw@MIT.EDU>
List: netbsd-bugs
Date: 07/17/1998 21:25:49
>Number:         5787
>Category:       bin
>Synopsis:       apmd is obnoxiously verbose
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 17 18:35:00 1998
>Last-Modified:
>Originator:     Dan Winship
>Organization:
MIT
>Release:        current
>Environment:
	
System: NetBSD spellbook.mit.edu 1.3F NetBSD 1.3F (SPELLBOOK) #4: Wed Jul 1 22:45:46 EDT 1998 root@spellbook.mit.edu:/u1/usr/src/sys/arch/i386/compile/SPELLBOOK i386


>Description:
	apmd spews all over my root logins:

Jul 17 20:49:14 spellbook apmd: battery status: high. external power status: connected. estimated battery life 90% (113 minutes)
Jul 17 20:49:16 spellbook apmd: battery status: high. external power status: connected. estimated battery life 90% (113 minutes)
Jul 17 20:50:02 spellbook apmd: battery status: high. external power status: connected. estimated battery life 90% (116 minutes)
Jul 17 20:50:17 spellbook apmd: battery status: high. external power status: connected. estimated battery life 90% (117 minutes)

	This sucks. There's all this clever code in apmd's
	power_status function to decide when the power state has
	changed enough to be worth mentioning, but it doesn't get used,
	because whenever apmd receives a power change event, it calls
	that function with the 'force' flag, causing it to babble at
	you about the miniscule change in your power status that you
	didn't care about, so you eventually get sick of it and make
	all the syslogs go away and then don't notice when your
	battery is about to run out.

>How-To-Repeat:
	
>Fix:
*** apmd.c.orig	Fri Jul 17 20:55:10 1998
--- apmd.c	Fri Jul 17 20:53:02 1998
***************
*** 437,443 ****
  		    resumes++;
  		    break;
  		case APM_POWER_CHANGE:
! 		    power_status(ctl_fd, 1, 0);
  		    break;
  		default:
  		    break;
--- 437,443 ----
  		    resumes++;
  		    break;
  		case APM_POWER_CHANGE:
! 		    power_status(ctl_fd, 0, 0);
  		    break;
  		default:
  		    break;

>Audit-Trail:
>Unformatted: