mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
Now that we've got it, use FDOPT_NOERRLOG for fdformat and fdwrite to
avoid blasting the syslog with error messages from bad floppies. Both tools have their own error reporting anyway (which could easily be cluttered by the syslog output on your terminal).
This commit is contained in:
parent
8a5f4c1290
commit
a5cef3b45a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=78858
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 1992-1994 by Joerg Wunsch, Dresden
|
* Copyright (C) 1992-1994,2001 by Joerg Wunsch, Dresden
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -173,6 +173,7 @@ main(int argc, char **argv)
|
||||||
int rate = -1, gaplen = -1, secsize = -1, steps = -1;
|
int rate = -1, gaplen = -1, secsize = -1, steps = -1;
|
||||||
int fill = 0xf6, quiet = 0, verify = 1, verify_only = 0, confirm = 0;
|
int fill = 0xf6, quiet = 0, verify = 1, verify_only = 0, confirm = 0;
|
||||||
int fd, c, track, error, tracks_per_dot, bytes_per_track, errs;
|
int fd, c, track, error, tracks_per_dot, bytes_per_track, errs;
|
||||||
|
int fdopts;
|
||||||
const char *devname, *suffix;
|
const char *devname, *suffix;
|
||||||
struct fd_type fdt;
|
struct fd_type fdt;
|
||||||
|
|
||||||
|
@ -265,6 +266,9 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
if(ioctl(fd, FD_GTYPE, &fdt) < 0)
|
if(ioctl(fd, FD_GTYPE, &fdt) < 0)
|
||||||
errx(1, "not a floppy disk: %s", devname);
|
errx(1, "not a floppy disk: %s", devname);
|
||||||
|
fdopts = FDOPT_NOERRLOG;
|
||||||
|
if (ioctl(fd, FD_SOPTS, &fdopts) == -1)
|
||||||
|
err(1, "ioctl(FD_SOPTS, FDOPT_NOERRLOG)");
|
||||||
|
|
||||||
switch(rate) {
|
switch(rate) {
|
||||||
case -1: break;
|
case -1: break;
|
||||||
|
|
|
@ -66,7 +66,7 @@ main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int inputfd = -1, c, fdn = 0, i,j,fd;
|
int inputfd = -1, c, fdn = 0, i,j,fd;
|
||||||
int bpt, verbose=1, nbytes=0, track;
|
int bpt, verbose=1, nbytes=0, track;
|
||||||
int interactive = 1;
|
int interactive = 1, fdopts;
|
||||||
char *device= "/dev/fd0", *trackbuf = 0,*vrfybuf = 0;
|
char *device= "/dev/fd0", *trackbuf = 0,*vrfybuf = 0;
|
||||||
struct fd_type fdt;
|
struct fd_type fdt;
|
||||||
FILE *tty;
|
FILE *tty;
|
||||||
|
@ -129,6 +129,9 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
if(ioctl(fd, FD_GTYPE, &fdt) < 0)
|
if(ioctl(fd, FD_GTYPE, &fdt) < 0)
|
||||||
errx(1, "not a floppy disk: %s", device);
|
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;
|
bpt = fdt.sectrac * (1<<fdt.secsize) * 128;
|
||||||
if(!trackbuf) {
|
if(!trackbuf) {
|
||||||
|
|
Loading…
Reference in a new issue