Date: Thu, 28 Jun 2001 00:25:25 -0700 From: Arun Sharma <arun@sharmas.dhs.org> To: FreeBSD-gnats-submit@freebsd.org Cc: paul@taniwha.com, mobile@freebsd.org Subject: [PATCH] kdeutils2 - apm issue Message-ID: <20010628002525.A15926@sharmas.dhs.org>
next in thread | raw e-mail | index | archive | help
>Submitter-Id: current-users
>Originator: Arun Sharma
>Organization:
>Confidential: no
>Synopsis: klaptop daemon incorrectly thinks that the battery time is 0
>Severity:
>Priority: medium
>Category: ports
>Class: sw-bug
>Release: FreeBSD 4.3-STABLE i386
>Environment:
System: FreeBSD omni.mirabella.net 4.3-STABLE FreeBSD 4.3-STABLE #3: Fri Jun 22 20:28:18 PDT 2001 root@omni.mirabella.net:/usr/src/sys/compile/omni i386
>Description:
When I pull out the AC line, KDE laptop daemon thinks that the battery
time is 0 and suspends the machine. The following patch fixes the problem.
>How-To-Repeat:
Install KDE and enable apm on a FreeBSD laptop.
>Fix:
--- kdeutils-2.1.1/klaptopdaemon/portable.cpp- Thu Jun 28 00:08:02 2001
+++ kdeutils-2.1.1/klaptopdaemon/portable.cpp Thu Jun 28 00:08:22 2001
@@ -453,7 +453,7 @@
if (ret == -1)
return 0;
- return (info.ai_batt_time != 0xffff);
+ return (info.ai_batt_time != -1);
}
//
@@ -638,7 +638,7 @@
p.powered = info.ai_acline;
p.percentage = (info.ai_batt_life==255 ? 100 : info.ai_batt_life);
- p.time = (info.ai_batt_time != 0xffff ? info.ai_batt_time/60 : -1);
+ p.time = (info.ai_batt_time != -1 ? info.ai_batt_time/60 : -1);
return(p);
bad:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mobile" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010628002525.A15926>
