From e8f2641919de90b488ce3788a7795b88311750b5 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 7 Dec 2006 00:25:49 +0100 Subject: Imported from util-linux-2.11m tarball. --- disk-utils/mkfs.minix.c | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'disk-utils/mkfs.minix.c') diff --git a/disk-utils/mkfs.minix.c b/disk-utils/mkfs.minix.c index 4c2afbb28..55d97e01e 100644 --- a/disk-utils/mkfs.minix.c +++ b/disk-utils/mkfs.minix.c @@ -160,11 +160,13 @@ static unsigned long req_nr_inodes = 0; #define mark_zone(x) (setbit(zone_map,(x)-FIRSTZONE+1)) #define unmark_zone(x) (clrbit(zone_map,(x)-FIRSTZONE+1)) +#ifndef HAVE_MINIX2 static void fatal_error(const char * fmt_string,int status) { fprintf(stderr,fmt_string,program_name,device_name); exit(status); } +#endif static void die(char *str) { @@ -600,22 +602,24 @@ check_blocks(void) { static void get_list_blocks(char *filename) { - FILE *listfile; - unsigned long blockno; + FILE *listfile; + unsigned long blockno; - listfile=fopen(filename,"r"); - if(listfile == (FILE *)NULL) { - die(_("can't open file of bad blocks")); - } - while(!feof(listfile)) { - fscanf(listfile,"%ld\n", &blockno); - mark_zone(blockno); - badblocks++; - } - if(badblocks > 1) - printf(_("%d bad blocks\n"), badblocks); - else if (badblocks == 1) - printf(_("one bad block\n")); + listfile = fopen(filename,"r"); + if (listfile == NULL) + die(_("can't open file of bad blocks")); + + while (!feof(listfile)) { + fscanf(listfile,"%ld\n", &blockno); + mark_zone(blockno); + badblocks++; + } + fclose(listfile); + + if(badblocks > 1) + printf(_("%d bad blocks\n"), badblocks); + else if (badblocks == 1) + printf(_("one bad block\n")); } int -- cgit v1.2.3-55-g7522