From eda0d0cadc2bce492583aae178549e95376548ed Mon Sep 17 00:00:00 2001 From: imp Date: Wed, 19 Jul 2000 06:34:02 +0000 Subject: 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. --- usr.sbin/apm/apm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'usr.sbin/apm') 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) -- cgit v1.1