summaryrefslogtreecommitdiffstats
path: root/usr.sbin/apm
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2000-07-19 06:34:02 +0000
committerimp <imp@FreeBSD.org>2000-07-19 06:34:02 +0000
commiteda0d0cadc2bce492583aae178549e95376548ed (patch)
treeacba014a7a1b1bb96cd41877197137269d33368c /usr.sbin/apm
parent985f9976749a6901c70dcac4860163517787af64 (diff)
downloadFreeBSD-src-eda0d0cadc2bce492583aae178549e95376548ed.zip
FreeBSD-src-eda0d0cadc2bce492583aae178549e95376548ed.tar.gz
When we're just reading info from the driver, attempt to open the apm
device read only so we can suppot a readonly apm device.
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 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