summaryrefslogtreecommitdiff
path: root/usr.sbin/apmd/apmd.c
diff options
context:
space:
mode:
authorRobert Nagy <robert@cvs.openbsd.org>2022-02-18 15:22:23 +0000
committerRobert Nagy <robert@cvs.openbsd.org>2022-02-18 15:22:23 +0000
commit68cdf41d44eb1d31fd23444c69b720faa1033916 (patch)
treef2698d9858d95b8e18cb4dd5445273ab8ebd9bfe /usr.sbin/apmd/apmd.c
parente3dac34e796b0f4cc04e8da610f90a2710063e4a (diff)
shut apmd up while the battery is coming to the full capacity when charging
to avoid filling up syslog with unnecessary information ok tb@
Diffstat (limited to 'usr.sbin/apmd/apmd.c')
-rw-r--r--usr.sbin/apmd/apmd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/apmd/apmd.c b/usr.sbin/apmd/apmd.c
index 4735c6d52cb..e03a499dbf2 100644
--- a/usr.sbin/apmd/apmd.c
+++ b/usr.sbin/apmd/apmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apmd.c,v 1.107 2022/02/06 09:07:42 robert Exp $ */
+/* $OpenBSD: apmd.c,v 1.108 2022/02/18 15:22:22 robert Exp $ */
/*
* Copyright (c) 1995, 1996 John T. Kohl
@@ -163,7 +163,8 @@ power_status(int fd, int force, struct apm_power_info *pinfo)
if (force ||
bstate.ac_state != last.ac_state ||
bstate.battery_state != last.battery_state ||
- (bstate.minutes_left && bstate.minutes_left < 15) ||
+ ((bstate.battery_state != APM_BATT_CHARGING) &&
+ (bstate.minutes_left && bstate.minutes_left < 15)) ||
abs(bstate.battery_life - last.battery_life) >= 10) {
if ((int)bstate.minutes_left > 0)
logmsg(priority, "battery status: %s. "