summaryrefslogtreecommitdiffstats
path: root/usr.sbin/fdformat
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>2001-07-03 21:43:41 +0000
committerjoerg <joerg@FreeBSD.org>2001-07-03 21:43:41 +0000
commitdd1382025f1fc023e360e70e0c6b2aa73df7c627 (patch)
tree1710e7bfb8dd10d0174b7f1e6ea7af4f264bd642 /usr.sbin/fdformat
parentde77c02347dd9757a222f8cb2398ca8d31d19e8d (diff)
downloadFreeBSD-src-dd1382025f1fc023e360e70e0c6b2aa73df7c627.zip
FreeBSD-src-dd1382025f1fc023e360e70e0c6b2aa73df7c627.tar.gz
Make fdformat WARN=2 ready.
Diffstat (limited to 'usr.sbin/fdformat')
-rw-r--r--usr.sbin/fdformat/Makefile2
-rw-r--r--usr.sbin/fdformat/fdformat.c18
2 files changed, 9 insertions, 11 deletions
diff --git a/usr.sbin/fdformat/Makefile b/usr.sbin/fdformat/Makefile
index 09e0224..2c14770 100644
--- a/usr.sbin/fdformat/Makefile
+++ b/usr.sbin/fdformat/Makefile
@@ -6,6 +6,6 @@ PROG= fdformat
SRCS= fdformat.c fdutil.c
CFLAGS= -I${.CURDIR}/../fdread
-WARNS?= 1
+WARNS?= 2
.include <bsd.prog.mk>
diff --git a/usr.sbin/fdformat/fdformat.c b/usr.sbin/fdformat/fdformat.c
index 157cb7d..0c194b3 100644
--- a/usr.sbin/fdformat/fdformat.c
+++ b/usr.sbin/fdformat/fdformat.c
@@ -145,7 +145,7 @@ usage (void)
{
fprintf(stderr, "%s\n%s\n",
"usage: fdformat [-y] [-q] [-n | -v] [-f #] [-c #] [-s #] [-h #]",
- " [-r #] [-g #] [-i #] [-S #] [-F #] [-t #] devname");
+ " [-r #] [-g #] [-i #] [-S #] [-F #] [-t #] device_name");
exit(2);
}
@@ -177,7 +177,7 @@ main(int argc, char **argv)
int fill = 0xf6, quiet = 0, verify = 1, verify_only = 0, confirm = 0;
int fd, c, i, track, error, tracks_per_dot, bytes_per_track, errs;
int fdopts;
- const char *devname, *suffix;
+ const char *device, *suffix;
struct fd_type fdt;
#define MAXPRINTERRS 10
struct fdc_status fdcs[MAXPRINTERRS];
@@ -264,13 +264,13 @@ main(int argc, char **argv)
case 1720: suffix = ".1720"; break;
}
- devname = makename(argv[optind], suffix);
+ device = makename(argv[optind], suffix);
- if((fd = open(devname, O_RDWR)) < 0)
- err(1, "%s", devname);
+ if((fd = open(device, O_RDWR)) < 0)
+ err(1, "%s", device);
if(ioctl(fd, FD_GTYPE, &fdt) < 0)
- errx(1, "not a floppy disk: %s", devname);
+ 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)");
@@ -303,12 +303,12 @@ main(int argc, char **argv)
if(!quiet)
printf("Verify %dK floppy `%s'.\n",
fdt.tracks * fdt.heads * bytes_per_track / 1024,
- devname);
+ device);
}
else if(!quiet && !confirm) {
printf("Format %dK floppy `%s'? (y/n): ",
fdt.tracks * fdt.heads * bytes_per_track / 1024,
- devname);
+ device);
if(! yes ()) {
printf("Not confirmed.\n");
return 3;
@@ -319,8 +319,6 @@ main(int argc, char **argv)
* Formatting.
*/
if(!quiet) {
- int i;
-
printf("Processing ");
for (i = 0; i < (fdt.tracks * fdt.heads) / tracks_per_dot; i++)
putchar('-');
OpenPOWER on IntegriCloud