Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Jun 2009 20:40:10 +0000 (UTC)
From:      Joerg Wunsch <joerg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r194899 - in stable/7/usr.sbin: fdcontrol fdformat fdread fdwrite
Message-ID:  <200906242040.n5OKeAAF028317@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: joerg
Date: Wed Jun 24 20:40:10 2009
New Revision: 194899
URL: http://svn.freebsd.org/changeset/base/194899

Log:
  Remove the defunct FDOPT_NOERRLOG; floppy media errors are no longer
  logged by the kernel anyway.
  
  In fdcontrol, open the file descriptor read-only, so the format for
  read-only media can be set.

Modified:
  stable/7/usr.sbin/fdcontrol/   (props changed)
  stable/7/usr.sbin/fdcontrol/fdcontrol.c
  stable/7/usr.sbin/fdformat/   (props changed)
  stable/7/usr.sbin/fdformat/fdformat.c
  stable/7/usr.sbin/fdread/   (props changed)
  stable/7/usr.sbin/fdread/fdread.c
  stable/7/usr.sbin/fdwrite/   (props changed)
  stable/7/usr.sbin/fdwrite/fdwrite.c

Modified: stable/7/usr.sbin/fdcontrol/fdcontrol.c
==============================================================================
--- stable/7/usr.sbin/fdcontrol/fdcontrol.c	Wed Jun 24 20:29:10 2009	(r194898)
+++ stable/7/usr.sbin/fdcontrol/fdcontrol.c	Wed Jun 24 20:40:10 2009	(r194899)
@@ -72,7 +72,7 @@ main(int argc, char **argv)
 	enum fd_drivetype type;
 	struct fd_type ft, newft, *fdtp;
 	const char *name, *descr;
-	int fd, i, mode, autofmt;
+	int fd, i, autofmt;
 
 	autofmt = 0;
 	while((i = getopt(argc, argv, "aFf:s:v")) != -1)
@@ -116,12 +116,7 @@ main(int argc, char **argv)
 	if(argc != 1)
 		usage();
 
-	if (show || showfmt)
-		mode = O_RDONLY | O_NONBLOCK;
-	else
-		mode = O_RDWR;
-
-	if((fd = open(argv[0], mode)) < 0)
+	if((fd = open(argv[0], O_RDONLY | O_NONBLOCK)) < 0)
 		err(EX_UNAVAILABLE, "open(%s)", argv[0]);
 
 	if (ioctl(fd, FD_GDTYPE, &type) == -1)

Modified: stable/7/usr.sbin/fdformat/fdformat.c
==============================================================================
--- stable/7/usr.sbin/fdformat/fdformat.c	Wed Jun 24 20:29:10 2009	(r194898)
+++ stable/7/usr.sbin/fdformat/fdformat.c	Wed Jun 24 20:40:10 2009	(r194899)
@@ -146,7 +146,7 @@ main(int argc, char **argv)
 	struct fdc_status fdcs[MAXPRINTERRS];
 	int format, fill, quiet, verify, verify_only, confirm;
 	int fd, c, i, track, error, tracks_per_dot, bytes_per_track, errs;
-	int fdopts, flags;
+	int flags;
 	char *fmtstring, *device;
 	const char *name, *descr;
 
@@ -250,11 +250,6 @@ main(int argc, char **argv)
 		errx(EX_OSERR, "not a floppy disk: %s", device);
 	if (ioctl(fd, FD_GDTYPE, &type) == -1)
 		err(EX_OSERR, "ioctl(FD_GDTYPE)");
-	if (ioctl(fd, FD_GOPTS, &fdopts) == -1)
-		err(EX_OSERR, "ioctl(FD_GOPTS)");
-	fdopts |= FDOPT_NOERRLOG;
-	if (ioctl(fd, FD_SOPTS, &fdopts) == -1)
-		err(EX_OSERR, "ioctl(FD_SOPTS, FDOPT_NOERRLOG)");
 	if (format) {
 		getname(type, &name, &descr);
 		fdtp = get_fmt(format, type);

Modified: stable/7/usr.sbin/fdread/fdread.c
==============================================================================
--- stable/7/usr.sbin/fdread/fdread.c	Wed Jun 24 20:29:10 2009	(r194898)
+++ stable/7/usr.sbin/fdread/fdread.c	Wed Jun 24 20:40:10 2009	(r194899)
@@ -166,9 +166,6 @@ doread(int fd, FILE *of, const char *_de
 
 	if (ioctl(fd, FD_GTYPE, &fdt) == -1)
 		err(EX_OSERR, "ioctl(FD_GTYPE) failed -- not a floppy?");
-	fdopts = FDOPT_NOERRLOG;
-	if (ioctl(fd, FD_SOPTS, &fdopts) == -1)
-		err(EX_OSERR, "ioctl(FD_SOPTS, FDOPT_NOERRLOG)");
 
 	secsize = 128 << fdt.secsize;
 	tracksize = fdt.sectrac * secsize;
@@ -300,7 +297,7 @@ doread(int fd, FILE *of, const char *_de
 int
 doreadid(int fd, unsigned int numids, unsigned int trackno)
 {
-	int rv = 0, fdopts;
+	int rv = 0;
 	unsigned int i;
 	struct fdc_readid info;
 	struct fdc_status fdcs;
@@ -309,10 +306,6 @@ doreadid(int fd, unsigned int numids, un
 	if (ioctl(fd, FD_GTYPE, &fdt) == -1)
 		err(EX_OSERR, "ioctl(FD_GTYPE) failed -- not a floppy?");
 
-	fdopts = FDOPT_NOERRLOG;
-	if (ioctl(fd, FD_SOPTS, &fdopts) == -1)
-		err(EX_OSERR, "ioctl(FD_SOPTS, FDOPT_NOERRLOG)");
-
 	for (i = 0; i < numids; i++) {
 		info.cyl = trackno / fdt.heads;
 		info.head = fdt.heads > 1? trackno % fdt.heads: 0;

Modified: stable/7/usr.sbin/fdwrite/fdwrite.c
==============================================================================
--- stable/7/usr.sbin/fdwrite/fdwrite.c	Wed Jun 24 20:29:10 2009	(r194898)
+++ stable/7/usr.sbin/fdwrite/fdwrite.c	Wed Jun 24 20:40:10 2009	(r194899)
@@ -66,7 +66,7 @@ main(int argc, char **argv)
 {
     int inputfd = -1, c, fdn = 0, i,j,fd;
     int bpt, verbose=1, nbytes=0, track;
-    int interactive = 1, fdopts;
+    int interactive = 1;
     const char *device= "/dev/fd0";
     char *trackbuf = 0,*vrfybuf = 0;
     struct fd_type fdt;
@@ -130,9 +130,6 @@ main(int argc, char **argv)
 
 	if(ioctl(fd, FD_GTYPE, &fdt) < 0)
 	    errx(1, "not a floppy disk: %s", device);
-	fdopts = FDOPT_NOERRLOG;
-	if (ioctl(fd, FD_SOPTS, &fdopts) == -1)
-		err(1, "ioctl(FD_SOPTS, FDOPT_NOERRLOG)");
 
 	bpt = fdt.sectrac * (1<<fdt.secsize) * 128;
 	if(!trackbuf) {



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