From 88a283005e37d51865005bf239bc658ed5ae9fd6 Mon Sep 17 00:00:00 2001 From: takawata Date: Thu, 4 Mar 2004 17:03:49 +0000 Subject: Make unprivilaged user can see battery info. --- usr.sbin/acpi/acpiconf/acpiconf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr.sbin/acpi/acpiconf/acpiconf.c b/usr.sbin/acpi/acpiconf/acpiconf.c index 377f0f9..123e485 100644 --- a/usr.sbin/acpi/acpiconf/acpiconf.c +++ b/usr.sbin/acpi/acpiconf/acpiconf.c @@ -44,13 +44,16 @@ #define RC_RESUME_PATH "/etc/rc.resume" static int acpifd; - static int acpi_init() { acpifd = open(ACPIDEV, O_RDWR); - if (acpifd == -1) + if (acpifd == -1){ + acpifd = open(ACPIDEV, O_RDONLY); + } + if (acpifd == -1){ err(EX_OSFILE, ACPIDEV); + } } static int -- cgit v1.1