summaryrefslogtreecommitdiff
path: root/sys/dev/acpi/acpi.c
diff options
context:
space:
mode:
authorMarco Peereboom <marco@cvs.openbsd.org>2007-03-26 03:52:50 +0000
committerMarco Peereboom <marco@cvs.openbsd.org>2007-03-26 03:52:50 +0000
commitcdb7afd89716938e1279ac2cf3727c7859f60315 (patch)
treef1b4049d4b91f5dc239b96ad2bd9db80d5530d52 /sys/dev/acpi/acpi.c
parentdd6cf4795ea9e01d64a908b91723160c29735870 (diff)
Calculate minutes left more accurately.
From giovanni <qgiovanni@gmail.com>
Diffstat (limited to 'sys/dev/acpi/acpi.c')
-rw-r--r--sys/dev/acpi/acpi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index b06ac87f7ea..471000417d4 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.85 2007/03/03 15:27:35 mk Exp $ */
+/* $OpenBSD: acpi.c,v 1.86 2007/03/26 03:52:49 marco Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -827,7 +827,7 @@ acpiioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
if (pi->ac_state == APM_AC_ON || rate == 0)
pi->minutes_left = (unsigned int)-1;
else
- pi->minutes_left = minutes / rate * 100;
+ pi->minutes_left = 100 * minutes / rate;
/* running on battery */
pi->battery_life = remaining / bats;