From cdb7afd89716938e1279ac2cf3727c7859f60315 Mon Sep 17 00:00:00 2001 From: Marco Peereboom Date: Mon, 26 Mar 2007 03:52:50 +0000 Subject: Calculate minutes left more accurately. From giovanni --- sys/dev/acpi/acpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/dev/acpi') 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 * Copyright (c) 2005 Jordan Hargrave @@ -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; -- cgit v1.2.3