From beee0062b5abea8fbe7b4a7c4cab797c90cfe8ba Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Fri, 17 Jun 2011 18:56:51 +0000 Subject: [PATCH] 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 --- usr.sbin/fdread/fdread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/fdread/fdread.c b/usr.sbin/fdread/fdread.c index 1aae665a1bd2..ba9c758bbc7b 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));