xref: /original-bsd/sbin/badsect/badsect.c (revision 0b685140)
1 static	char *sccsid = "@(#)badsect.c	4.2 (Berkeley) 81/05/11";
2 
3 /*
4  * badsect
5  *
6  * Badsect takes a list of file-system relative sector numbers
7  * and makes files containing the blocks of which these sectors are a part.
8  * It can be used to contain sectors which have problems if these sectors
9  * are not part of the bad file for the pack (see bad144).  For instance,
10  * this program can be used if the driver for the file system in question
11  * does not support bad block forwarding.
12  */
13 #include <sys/param.h>
14 
15 main(argc, argv)
16 	int argc;
17 	char **argv;
18 {
19 	char nambuf[32];
20 	int errs = 0;
21 
22 	--argc, argv++;
23 	while (argc > 0) {
24 		if (mknod(*argv, 0, atoi(*argv) / CLSIZE))
25 			perror("mknod"), errs++;
26 		argc--, argv++;
27 	}
28 	exit(errs);
29 }
30