diff options
author | Joerg Wunsch <joerg@FreeBSD.org> | 2009-06-24 19:47:53 +0000 |
---|---|---|
committer | Joerg Wunsch <joerg@FreeBSD.org> | 2009-06-24 19:47:53 +0000 |
commit | 81f5cd998c10885d9483f90776575f68c50f92b5 (patch) | |
tree | 7c80e7b291959bae36b32f2ec52a06cf667479e5 /usr.sbin/fdcontrol | |
parent | 3fdc1d5c487e0702b4890584f1195d567ec9ed31 (diff) | |
download | src-81f5cd998c10885d9483f90776575f68c50f92b5.tar.gz src-81f5cd998c10885d9483f90776575f68c50f92b5.zip |
Notes
Diffstat (limited to 'usr.sbin/fdcontrol')
-rw-r--r-- | usr.sbin/fdcontrol/fdcontrol.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/usr.sbin/fdcontrol/fdcontrol.c b/usr.sbin/fdcontrol/fdcontrol.c index f1a923393d76..91877e64643c 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) |