Deleted Added
full compact
26c26
< * $FreeBSD: head/usr.sbin/fdformat/fdformat.c 78858 2001-06-26 22:19:32Z joerg $
---
> * $FreeBSD: head/usr.sbin/fdformat/fdformat.c 79111 2001-07-02 21:24:03Z joerg $
44a45
> #include <errno.h>
53a55,56
> #include "fdutil.h"
>
175c178
< int fd, c, track, error, tracks_per_dot, bytes_per_track, errs;
---
> int fd, c, i, track, error, tracks_per_dot, bytes_per_track, errs;
178a182,183
> #define MAXPRINTERRS 10
> struct fdc_status fdcs[MAXPRINTERRS];
339,340c344,353
< if (verify_track(fd, track, bytes_per_track) < 0)
< error = errs = 1;
---
> if (verify_track(fd, track, bytes_per_track) < 0) {
> error = 1;
> if (errs < MAXPRINTERRS && errno == EIO) {
> if (ioctl(fd, FD_GSTAT, fdcs + errs) ==
> -1)
> errx(1,
> "floppy IO error, but no FDC status");
> errs++;
> }
> }
357c370,384
< return errs;
---
> if (!quiet && errs) {
> fflush(stdout);
> fprintf(stderr, "Errors encountered:\nCyl Head Sect Error\n");
> for (i = 0; i < errs && i < MAXPRINTERRS; i++) {
> fprintf(stderr, " %2d %2d %2d ",
> fdcs[i].status[3], fdcs[i].status[4],
> fdcs[i].status[5]);
> printstatus(fdcs + i, 1);
> putc('\n', stderr);
> }
> if (errs >= MAXPRINTERRS)
> fprintf(stderr, "(Further errors not printed.)\n");
> }
>
> return errs != 0;
359,373d385
< /*
< * Local Variables:
< * c-indent-level: 8
< * c-continued-statement-offset: 8
< * c-continued-brace-offset: 0
< * c-brace-offset: -8
< * c-brace-imaginary-offset: 0
< * c-argdecl-indent: 8
< * c-label-offset: -8
< * c++-hanging-braces: 1
< * c++-access-specifier-offset: -8
< * c++-empty-arglist-indent: 8
< * c++-friend-offset: 0
< * End:
< */