summaryrefslogtreecommitdiffstats
path: root/usr.sbin/fdcontrol
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>2009-06-24 19:47:53 +0000
committerjoerg <joerg@FreeBSD.org>2009-06-24 19:47:53 +0000
commit28ee5250ac542f0374f1ec07f32276a5581a2353 (patch)
tree7c80e7b291959bae36b32f2ec52a06cf667479e5 /usr.sbin/fdcontrol
parent8c4a62bd5baed926c5edabe6c2a36fe1d5cf7376 (diff)
downloadFreeBSD-src-28ee5250ac542f0374f1ec07f32276a5581a2353.zip
FreeBSD-src-28ee5250ac542f0374f1ec07f32276a5581a2353.tar.gz
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.
Diffstat (limited to 'usr.sbin/fdcontrol')
-rw-r--r--usr.sbin/fdcontrol/fdcontrol.c9
1 files changed, 2 insertions, 7 deletions
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)
OpenPOWER on IntegriCloud