summaryrefslogtreecommitdiffstats
path: root/disk-utils/mkfs.minix.c
diff options
context:
space:
mode:
authorKarel Zak2006-12-07 00:25:49 +0100
committerKarel Zak2006-12-07 00:25:49 +0100
commite8f2641919de90b488ce3788a7795b88311750b5 (patch)
tree68f3732da38ff1b21ec49780d7c830250329fec9 /disk-utils/mkfs.minix.c
parentImported from util-linux-2.11f tarball. (diff)
downloadkernel-qcow2-util-linux-e8f2641919de90b488ce3788a7795b88311750b5.tar.gz
kernel-qcow2-util-linux-e8f2641919de90b488ce3788a7795b88311750b5.tar.xz
kernel-qcow2-util-linux-e8f2641919de90b488ce3788a7795b88311750b5.zip
Imported from util-linux-2.11m tarball.
Diffstat (limited to 'disk-utils/mkfs.minix.c')
-rw-r--r--disk-utils/mkfs.minix.c34
1 files changed, 19 insertions, 15 deletions
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