From 28ee5250ac542f0374f1ec07f32276a5581a2353 Mon Sep 17 00:00:00 2001 From: joerg Date: Wed, 24 Jun 2009 19:47:53 +0000 Subject: Drop the defunct FDOPT_NOERRLOG option from all the floppy utilities. The kernel does not log floppy media errors anymore. In fdcontrol, do always open the file descriptor in read-only mode so it can operate on read-only media, as there is no longer a separate control device to operate on. --- usr.sbin/fdcontrol/fdcontrol.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'usr.sbin/fdcontrol') diff --git a/usr.sbin/fdcontrol/fdcontrol.c b/usr.sbin/fdcontrol/fdcontrol.c index f1a9233..91877e6 100644 --- a/usr.sbin/fdcontrol/fdcontrol.c +++ b/usr.sbin/fdcontrol/fdcontrol.c @@ -72,7 +72,7 @@ main(int argc, char **argv) enum fd_drivetype type; struct fd_type ft, newft, *fdtp; const char *name, *descr; - int fd, i, mode, autofmt; + int fd, i, autofmt; autofmt = 0; while((i = getopt(argc, argv, "aFf:s:v")) != -1) @@ -116,12 +116,7 @@ main(int argc, char **argv) if(argc != 1) usage(); - if (show || showfmt) - mode = O_RDONLY | O_NONBLOCK; - else - mode = O_RDWR; - - if((fd = open(argv[0], mode)) < 0) + if((fd = open(argv[0], O_RDONLY | O_NONBLOCK)) < 0) err(EX_UNAVAILABLE, "open(%s)", argv[0]); if (ioctl(fd, FD_GDTYPE, &type) == -1) -- cgit v1.1