summaryrefslogtreecommitdiffstats
path: root/usr.sbin/apm/apm.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/apm/apm.c')
-rw-r--r--usr.sbin/apm/apm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/apm/apm.c b/usr.sbin/apm/apm.c
index 89d3a50..e64dc7b 100644
--- a/usr.sbin/apm/apm.c
+++ b/usr.sbin/apm/apm.c
@@ -412,7 +412,10 @@ main(int argc, char *argv[])
argv += optind;
}
finish_option:
- fd = open(APMDEV, O_RDWR);
+ if (haltcpu != -1 || enable != -1 || delta || sleep || standby)
+ fd = open(APMDEV, O_RDWR);
+ else
+ fd = open(APMDEV, O_RDONLY);
if (fd == -1)
err(1, "can't open %s", APMDEV);
if (enable != -1)
OpenPOWER on IntegriCloud