summaryrefslogtreecommitdiffstats
path: root/usr.sbin/acpi/acpiconf
diff options
context:
space:
mode:
authortakawata <takawata@FreeBSD.org>2004-03-04 17:03:49 +0000
committertakawata <takawata@FreeBSD.org>2004-03-04 17:03:49 +0000
commit88a283005e37d51865005bf239bc658ed5ae9fd6 (patch)
tree15c23e848639cc9a9965635fbecd4fcb84c661dd /usr.sbin/acpi/acpiconf
parentc1c4026c1a1dcf313703864c9a80e34a85dd59bd (diff)
downloadFreeBSD-src-88a283005e37d51865005bf239bc658ed5ae9fd6.zip
FreeBSD-src-88a283005e37d51865005bf239bc658ed5ae9fd6.tar.gz
Make unprivilaged user can see battery info.
Diffstat (limited to 'usr.sbin/acpi/acpiconf')
-rw-r--r--usr.sbin/acpi/acpiconf/acpiconf.c7
1 files 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
OpenPOWER on IntegriCloud