diff options
author | joerg <joerg@FreeBSD.org> | 2011-06-17 18:56:51 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 2011-06-17 18:56:51 +0000 |
commit | 9b8ca74145a30b8660c7493115862370d5cd4299 (patch) | |
tree | 130927364de462ed28280e4f8dc1536b98d693b2 /usr.sbin/fdread | |
parent | c7a72567a8474dcecd93215073976b04171d1144 (diff) | |
download | FreeBSD-src-9b8ca74145a30b8660c7493115862370d5cd4299.zip FreeBSD-src-9b8ca74145a30b8660c7493115862370d5cd4299.tar.gz |
Open the floppy disk device with O_RDONLY rather than O_RDWR. After
all, this is the fd*read* command, and thus should be able to read
even write-protected disks.
MFC after: 1 week
Diffstat (limited to 'usr.sbin/fdread')
-rw-r--r-- | usr.sbin/fdread/fdread.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/fdread/fdread.c b/usr.sbin/fdread/fdread.c index 1aae665..ba9c758 100644 --- a/usr.sbin/fdread/fdread.c +++ b/usr.sbin/fdread/fdread.c @@ -149,7 +149,7 @@ main(int argc, char **argv) err(EX_OSERR, "cannot create output file %s", fname); } - if ((fd = open(_devname, O_RDWR)) == -1) + if ((fd = open(_devname, O_RDONLY)) == -1) err(EX_OSERR, "cannot open device %s", _devname); return (numids? doreadid(fd, numids, trackno): doread(fd, of, _devname)); |