Open devices RDONLY for ioctls. That makes it work on open devices to which
GEOM doesn't allow WR access.
This commit is contained in:
parent
7217408a65
commit
265fa8db1d
@ -307,7 +307,7 @@ main(int argc, char **argv)
|
||||
exit(EX_USAGE);
|
||||
}
|
||||
sprintf(device, "/dev/%s", argv[2]);
|
||||
if ((fd = open(device, O_RDWR)) < 0)
|
||||
if ((fd = open(device, O_RDONLY)) < 0)
|
||||
err(1, "device not found");
|
||||
if (argc == 4) {
|
||||
mode = str2mode(argv[3]);
|
||||
@ -334,7 +334,7 @@ main(int argc, char **argv)
|
||||
exit(EX_USAGE);
|
||||
}
|
||||
sprintf(device, "/dev/%s", argv[2]);
|
||||
if ((fd = open(device, O_RDWR)) < 0)
|
||||
if ((fd = open(device, O_RDONLY)) < 0)
|
||||
err(1, "device not found");
|
||||
ata_cap_print(fd);
|
||||
exit(EX_OK);
|
||||
|
Loading…
x
Reference in New Issue
Block a user