From owner-freebsd-mobile Thu Jun 28 0:25:22 2001 Delivered-To: freebsd-mobile@freebsd.org Received: from sharmas.dhs.org (cpe-66-1-147-119.ca.sprintbbd.net [66.1.147.119]) by hub.freebsd.org (Postfix) with ESMTP id 1167A37B401; Thu, 28 Jun 2001 00:25:19 -0700 (PDT) (envelope-from adsharma@sharmas.dhs.org) Received: (from adsharma@localhost) by sharmas.dhs.org (8.11.3/8.11.3) id f5S7PV415954; Thu, 28 Jun 2001 00:25:31 -0700 (PDT) (envelope-from adsharma) Date: Thu, 28 Jun 2001 00:25:25 -0700 From: Arun Sharma 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-send-pr-version: 3.113 Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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