diff options
author | Karel Zak <kzak@redhat.com> | 2006-12-07 00:25:49 +0100 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2006-12-07 00:25:49 +0100 |
commit | e8f2641919de90b488ce3788a7795b88311750b5 (patch) | |
tree | 68f3732da38ff1b21ec49780d7c830250329fec9 /disk-utils/mkfs.minix.c | |
parent | 364cda4857f7dd5e2b4e2eb7583a2eaa279ef4ed (diff) | |
download | util-linux-old-e8f2641919de90b488ce3788a7795b88311750b5.tar.gz |
Imported from util-linux-2.11m tarball.
Diffstat (limited to 'disk-utils/mkfs.minix.c')
-rw-r--r-- | disk-utils/mkfs.minix.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/disk-utils/mkfs.minix.c b/disk-utils/mkfs.minix.c index 4c2afbb2..55d97e01 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 |