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.
This commit is contained in:
Warner Losh 2000-07-19 06:34:02 +00:00
parent 785c4f1a3d
commit ad5536b59f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=63495

View File

@ -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)