aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/apm
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2000-07-20 16:59:20 +0000
committerWarner Losh <imp@FreeBSD.org>2000-07-20 16:59:20 +0000
commit719a5e9b6ca7c9a17fd6e2dbd7a8a896f5146919 (patch)
tree4b901bde5f01ec1fd7289f2d0aa7354f89910659 /usr.sbin/apm
parentc08ca7e5d30392aab4954eb38a52503df9ba2daf (diff)
Notes
Diffstat (limited to 'usr.sbin/apm')
-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 89d3a50ce3a9..e64dc7b5fd72 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)