From cb89fb11b72955c2abe1440056071e1d75a97e31 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Wed, 26 Oct 2005 22:28:38 +0000 Subject: [PATCH] fdread cannot work without opening the /dev/fd node in O_RDWR mode now, because it sets the floppy controller parameters, which requires O_RDWR. Specifically, the FD_SOPTS ioctl requires this, and the code errors out and aborts if it can't do it. Among other things, it is changing the FDOPT_NOERRLOG flag. Broken in 6.0 as well. --- 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 8aee99bd0c70..813517062fd4 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_RDONLY)) == -1) + if ((fd = open(_devname, O_RDWR)) == -1) err(EX_OSERR, "cannot open device %s", _devname); return (numids? doreadid(fd, numids, trackno): doread(fd, of, _devname));