svn commit: r223514 - stable/8/usr.sbin/fdread
Joerg Wunsch
joerg at FreeBSD.org
Fri Jun 24 19:24:57 UTC 2011
Author: joerg
Date: Fri Jun 24 19:24:56 2011
New Revision: 223514
URL: http://svn.freebsd.org/changeset/base/223514
Log:
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.
Modified:
stable/8/usr.sbin/fdread/fdread.c
Directory Properties:
stable/8/usr.sbin/fdread/ (props changed)
Modified: stable/8/usr.sbin/fdread/fdread.c
==============================================================================
--- stable/8/usr.sbin/fdread/fdread.c Fri Jun 24 19:02:56 2011 (r223513)
+++ stable/8/usr.sbin/fdread/fdread.c Fri Jun 24 19:24:56 2011 (r223514)
@@ -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));
More information about the svn-src-stable
mailing list