Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Jun 2011 18:56:51 +0000 (UTC)
From:      Joerg Wunsch <joerg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r223197 - head/usr.sbin/fdread
Message-ID:  <201106171856.p5HIuplN002929@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: joerg
Date: Fri Jun 17 18:56:51 2011
New Revision: 223197
URL: http://svn.freebsd.org/changeset/base/223197

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.
  
  MFC after:	1 week

Modified:
  head/usr.sbin/fdread/fdread.c

Modified: head/usr.sbin/fdread/fdread.c
==============================================================================
--- head/usr.sbin/fdread/fdread.c	Fri Jun 17 18:49:59 2011	(r223196)
+++ head/usr.sbin/fdread/fdread.c	Fri Jun 17 18:56:51 2011	(r223197)
@@ -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));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106171856.p5HIuplN002929>