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