summaryrefslogtreecommitdiff
path: root/util-linux/fsck_minix.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-06-13 15:31:39 +0000
committerRob Landley <rob@landley.net>2006-06-13 15:31:39 +0000
commitfd8409f8c5868d15a427f1e042352e7fc5372e35 (patch)
tree4388b8e0169cb5d75ed6825129cb89c7a9359669 /util-linux/fsck_minix.c
parent9a1a9de49f4a6fdbd02150cf4404d2b127d79cbe (diff)
downloadbusybox-w32-fd8409f8c5868d15a427f1e042352e7fc5372e35.tar.gz
busybox-w32-fd8409f8c5868d15a427f1e042352e7fc5372e35.tar.bz2
busybox-w32-fd8409f8c5868d15a427f1e042352e7fc5372e35.zip
Patch from Denis Vlasenko, tweak error messages.
Diffstat (limited to 'util-linux/fsck_minix.c')
-rw-r--r--util-linux/fsck_minix.c102
1 files changed, 50 insertions, 52 deletions
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index a5d52b26c..a9c4467d8 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -250,7 +250,7 @@ static void recursive_check(unsigned int ino);
250static void recursive_check2(unsigned int ino); 250static void recursive_check2(unsigned int ino);
251#endif 251#endif
252 252
253static inline int bit(char * a,unsigned int i) 253static inline int bit(char *a, unsigned int i)
254{ 254{
255 return (a[i >> 3] & (1<<(i & 7))) != 0; 255 return (a[i >> 3] & (1<<(i & 7))) != 0;
256} 256}
@@ -402,7 +402,7 @@ static void check_mount(void)
402 else 402 else
403 close(fd); 403 close(fd);
404 404
405 printf("%s is mounted. ", device_name); 405 printf("%s is mounted. ", device_name);
406 cont = 0; 406 cont = 0;
407 if (isatty(0) && isatty(1)) 407 if (isatty(0) && isatty(1))
408 cont = ask("Do you really want to continue", 0); 408 cont = ask("Do you really want to continue", 0);
@@ -430,7 +430,7 @@ static int check_zone_nr2(uint32_t *nr, int *corrected)
430 msg = ">= ZONES"; 430 msg = ">= ZONES";
431 else 431 else
432 return *nr; 432 return *nr;
433 printf("Zone nr %s in file '%s'.", msg, current_name); 433 printf("Zone nr %s in file '%s'. ", msg, current_name);
434 if (ask("Remove block", 1)) { 434 if (ask("Remove block", 1)) {
435 *nr = 0; 435 *nr = 0;
436 *corrected = 1; 436 *corrected = 1;
@@ -482,7 +482,7 @@ static void write_block(unsigned int nr, char *addr)
482 return; 482 return;
483 } 483 }
484 if (BLOCK_SIZE * nr != lseek(IN, BLOCK_SIZE * nr, SEEK_SET)) 484 if (BLOCK_SIZE * nr != lseek(IN, BLOCK_SIZE * nr, SEEK_SET))
485 die("seek failed in write_block"); 485 die("Seek failed in write_block");
486 if (BLOCK_SIZE != write(IN, addr, BLOCK_SIZE)) { 486 if (BLOCK_SIZE != write(IN, addr, BLOCK_SIZE)) {
487 printf("%s: bad block in file '%s'\n", 487 printf("%s: bad block in file '%s'\n",
488 bb_msg_write_error, current_name); 488 bb_msg_write_error, current_name);
@@ -602,9 +602,9 @@ static void write_super_block(void)
602 Super.s_state &= ~MINIX_ERROR_FS; 602 Super.s_state &= ~MINIX_ERROR_FS;
603 603
604 if (BLOCK_SIZE != lseek(IN, BLOCK_SIZE, SEEK_SET)) 604 if (BLOCK_SIZE != lseek(IN, BLOCK_SIZE, SEEK_SET))
605 die("seek failed in write_super_block"); 605 die("Seek failed in write_super_block");
606 if (BLOCK_SIZE != write(IN, super_block_buffer, BLOCK_SIZE)) 606 if (BLOCK_SIZE != write(IN, super_block_buffer, BLOCK_SIZE))
607 die("unable to write super-block"); 607 die("Unable to write super-block");
608} 608}
609 609
610static void write_tables(void) 610static void write_tables(void)
@@ -645,9 +645,9 @@ static void get_dirsize(void)
645static void read_superblock(void) 645static void read_superblock(void)
646{ 646{
647 if (BLOCK_SIZE != lseek(IN, BLOCK_SIZE, SEEK_SET)) 647 if (BLOCK_SIZE != lseek(IN, BLOCK_SIZE, SEEK_SET))
648 die("seek failed"); 648 die("Seek failed");
649 if (BLOCK_SIZE != read(IN, super_block_buffer, BLOCK_SIZE)) 649 if (BLOCK_SIZE != read(IN, super_block_buffer, BLOCK_SIZE))
650 die("unable to read super block"); 650 die("Unable to read super block");
651 /* already initialized to: 651 /* already initialized to:
652 namelen = 14; 652 namelen = 14;
653 dirsize = 16; 653 dirsize = 16;
@@ -666,13 +666,13 @@ static void read_superblock(void)
666 version2 = 1; 666 version2 = 1;
667#endif 667#endif
668 } else 668 } else
669 die("bad magic number in super-block"); 669 die("Bad magic number in super-block");
670 if (ZONESIZE != 0 || BLOCK_SIZE != 1024) 670 if (ZONESIZE != 0 || BLOCK_SIZE != 1024)
671 die("Only 1k blocks/zones supported"); 671 die("Only 1k blocks/zones supported");
672 if (IMAPS * BLOCK_SIZE * 8 < INODES + 1) 672 if (IMAPS * BLOCK_SIZE * 8 < INODES + 1)
673 die("bad s_imap_blocks field in super-block"); 673 die("Bad s_imap_blocks field in super-block");
674 if (ZMAPS * BLOCK_SIZE * 8 < ZONES - FIRSTZONE + 1) 674 if (ZMAPS * BLOCK_SIZE * 8 < ZONES - FIRSTZONE + 1)
675 die("bad s_zmap_blocks field in super-block"); 675 die("Bad s_zmap_blocks field in super-block");
676} 676}
677 677
678static void read_tables(void) 678static void read_tables(void)
@@ -689,7 +689,7 @@ static void read_tables(void)
689 if (INODE_BUFFER_SIZE != read(IN, inode_buffer, INODE_BUFFER_SIZE)) 689 if (INODE_BUFFER_SIZE != read(IN, inode_buffer, INODE_BUFFER_SIZE))
690 die("Unable to read inodes"); 690 die("Unable to read inodes");
691 if (NORM_FIRSTZONE != FIRSTZONE) { 691 if (NORM_FIRSTZONE != FIRSTZONE) {
692 printf("Warning: Firstzone != Norm_firstzone\n"); 692 printf("Warning: Firstzone!=Norm_firstzone\n");
693 errors_uncorrected = 1; 693 errors_uncorrected = 1;
694 } 694 }
695 get_dirsize(); 695 get_dirsize();
@@ -721,10 +721,10 @@ static struct minix_inode *get_inode(unsigned int nr)
721 inode = Inode + nr; 721 inode = Inode + nr;
722 if (!inode_count[nr]) { 722 if (!inode_count[nr]) {
723 if (!inode_in_use(nr)) { 723 if (!inode_in_use(nr)) {
724 printf("Inode %d marked not used, but used for file " 724 printf("Inode %d is marked as 'unused', but it is used "
725 "'%s'\n", nr, current_name); 725 "for file '%s'\n", nr, current_name);
726 if (repair) { 726 if (repair) {
727 if (ask("Mark in use", 1)) 727 if (ask("Mark as 'in use'", 1))
728 mark_inode(nr); 728 mark_inode(nr);
729 } else { 729 } else {
730 errors_uncorrected = 1; 730 errors_uncorrected = 1;
@@ -767,10 +767,10 @@ static struct minix2_inode *get_inode2(unsigned int nr)
767 inode = Inode2 + nr; 767 inode = Inode2 + nr;
768 if (!inode_count[nr]) { 768 if (!inode_count[nr]) {
769 if (!inode_in_use(nr)) { 769 if (!inode_in_use(nr)) {
770 printf("Inode %d marked not used, but used for file " 770 printf("Inode %d is marked as 'unused', but it is used "
771 "'%s'\n", nr, current_name); 771 "for file '%s'\n", nr, current_name);
772 if (repair) { 772 if (repair) {
773 if (ask("Mark in use", 1)) 773 if (ask("Mark as 'in use'", 1))
774 mark_inode(nr); 774 mark_inode(nr);
775 else 775 else
776 errors_uncorrected = 1; 776 errors_uncorrected = 1;
@@ -807,7 +807,7 @@ static void check_root(void)
807 struct minix_inode *inode = Inode + ROOT_INO; 807 struct minix_inode *inode = Inode + ROOT_INO;
808 808
809 if (!inode || !S_ISDIR(inode->i_mode)) 809 if (!inode || !S_ISDIR(inode->i_mode))
810 die("root inode isn't a directory"); 810 die("Root inode isn't a directory");
811} 811}
812 812
813#ifdef CONFIG_FEATURE_MINIX2 813#ifdef CONFIG_FEATURE_MINIX2
@@ -816,7 +816,7 @@ static void check_root2(void)
816 struct minix2_inode *inode = Inode2 + ROOT_INO; 816 struct minix2_inode *inode = Inode2 + ROOT_INO;
817 817
818 if (!inode || !S_ISDIR(inode->i_mode)) 818 if (!inode || !S_ISDIR(inode->i_mode))
819 die("root inode isn't a directory"); 819 die("Root inode isn't a directory");
820} 820}
821#endif 821#endif
822 822
@@ -830,7 +830,7 @@ static int add_zone(uint16_t *znr, int *corrected)
830 if (!block) 830 if (!block)
831 return 0; 831 return 0;
832 if (zone_count[block]) { 832 if (zone_count[block]) {
833 printf("Block has been used before. Now in file '%s'.", 833 printf("Already used block is reused in file '%s'. ",
834 current_name); 834 current_name);
835 if (ask("Clear", 1)) { 835 if (ask("Clear", 1)) {
836 *znr = 0; 836 *znr = 0;
@@ -840,7 +840,7 @@ static int add_zone(uint16_t *znr, int *corrected)
840 } 840 }
841 } 841 }
842 if (!zone_in_use(block)) { 842 if (!zone_in_use(block)) {
843 printf("Block %d in file '%s' is marked not in use.", 843 printf("Block %d in file '%s' is marked as 'unused'. ",
844 block, current_name); 844 block, current_name);
845 if (ask("Correct", 1)) 845 if (ask("Correct", 1))
846 mark_zone(block); 846 mark_zone(block);
@@ -861,7 +861,7 @@ static int add_zone2(uint32_t *znr, int *corrected)
861 if (!block) 861 if (!block)
862 return 0; 862 return 0;
863 if (zone_count[block]) { 863 if (zone_count[block]) {
864 printf("Block has been used before. Now in file '%s'.", 864 printf("Already used block is reused in file '%s'. ",
865 current_name); 865 current_name);
866 if (ask("Clear", 1)) { 866 if (ask("Clear", 1)) {
867 *znr = 0; 867 *znr = 0;
@@ -871,7 +871,7 @@ static int add_zone2(uint32_t *znr, int *corrected)
871 } 871 }
872 } 872 }
873 if (!zone_in_use(block)) { 873 if (!zone_in_use(block)) {
874 printf("Block %d in file '%s' is marked not in use.", 874 printf("Block %d in file '%s' is marked as 'unused'. ",
875 block, current_name); 875 block, current_name);
876 if (ask("Correct", 1)) 876 if (ask("Correct", 1))
877 mark_zone(block); 877 mark_zone(block);
@@ -1017,9 +1017,9 @@ static void check_file(struct minix_inode *dir, unsigned int offset)
1017 name = blk + (offset % BLOCK_SIZE) + 2; 1017 name = blk + (offset % BLOCK_SIZE) + 2;
1018 ino = *(uint16_t *) (name - 2); 1018 ino = *(uint16_t *) (name - 2);
1019 if (ino > INODES) { 1019 if (ino > INODES) {
1020 printf("%s contains a bad inode number for file '%.*s'.", 1020 printf("%s contains a bad inode number for file '%.*s'. ",
1021 current_name, namelen, name); 1021 current_name, namelen, name);
1022 if (ask(" Remove", 1)) { 1022 if (ask("Remove", 1)) {
1023 *(uint16_t *) (name - 2) = 0; 1023 *(uint16_t *) (name - 2) = 0;
1024 write_block(block, blk); 1024 write_block(block, blk);
1025 } 1025 }
@@ -1071,9 +1071,9 @@ static void check_file2(struct minix2_inode *dir, unsigned int offset)
1071 name = blk + (offset % BLOCK_SIZE) + 2; 1071 name = blk + (offset % BLOCK_SIZE) + 2;
1072 ino = *(uint16_t *) (name - 2); 1072 ino = *(uint16_t *) (name - 2);
1073 if (ino > INODES) { 1073 if (ino > INODES) {
1074 printf("%s contains a bad inode number for file '%.*s'.", 1074 printf("%s contains a bad inode number for file '%.*s'. ",
1075 current_name, namelen, name); 1075 current_name, namelen, name);
1076 if (ask(" Remove", 1)) { 1076 if (ask("Remove", 1)) {
1077 *(uint16_t *) (name - 2) = 0; 1077 *(uint16_t *) (name - 2) = 0;
1078 write_block(block, blk); 1078 write_block(block, blk);
1079 } 1079 }
@@ -1119,7 +1119,7 @@ static void recursive_check(unsigned int ino)
1119 1119
1120 dir = Inode + ino; 1120 dir = Inode + ino;
1121 if (!S_ISDIR(dir->i_mode)) 1121 if (!S_ISDIR(dir->i_mode))
1122 die("internal error"); 1122 die("Internal error");
1123 if (dir->i_size < 2 * dirsize) { 1123 if (dir->i_size < 2 * dirsize) {
1124 printf("%s: bad directory: size<32", current_name); 1124 printf("%s: bad directory: size<32", current_name);
1125 errors_uncorrected = 1; 1125 errors_uncorrected = 1;
@@ -1136,7 +1136,7 @@ static void recursive_check2(unsigned int ino)
1136 1136
1137 dir = Inode2 + ino; 1137 dir = Inode2 + ino;
1138 if (!S_ISDIR(dir->i_mode)) 1138 if (!S_ISDIR(dir->i_mode))
1139 die("internal error"); 1139 die("Internal error");
1140 if (dir->i_size < 2 * dirsize) { 1140 if (dir->i_size < 2 * dirsize) {
1141 printf("%s: bad directory: size<32", current_name); 1141 printf("%s: bad directory: size<32", current_name);
1142 errors_uncorrected = 1; 1142 errors_uncorrected = 1;
@@ -1151,7 +1151,7 @@ static int bad_zone(int i)
1151 char buffer[1024]; 1151 char buffer[1024];
1152 1152
1153 if (BLOCK_SIZE * i != lseek(IN, BLOCK_SIZE * i, SEEK_SET)) 1153 if (BLOCK_SIZE * i != lseek(IN, BLOCK_SIZE * i, SEEK_SET))
1154 die("seek failed in bad_zone"); 1154 die("Seek failed in bad_zone");
1155 return (BLOCK_SIZE != read(IN, buffer, BLOCK_SIZE)); 1155 return (BLOCK_SIZE != read(IN, buffer, BLOCK_SIZE));
1156} 1156}
1157 1157
@@ -1161,7 +1161,7 @@ static void check_counts(void)
1161 1161
1162 for (i = 1; i <= INODES; i++) { 1162 for (i = 1; i <= INODES; i++) {
1163 if (warn_mode && Inode[i].i_mode && !inode_in_use(i)) { 1163 if (warn_mode && Inode[i].i_mode && !inode_in_use(i)) {
1164 printf("Inode %d mode not cleared.", i); 1164 printf("Inode %d has non-zero mode. ", i);
1165 if (ask("Clear", 1)) { 1165 if (ask("Clear", 1)) {
1166 Inode[i].i_mode = 0; 1166 Inode[i].i_mode = 0;
1167 changed = 1; 1167 changed = 1;
@@ -1170,18 +1170,18 @@ static void check_counts(void)
1170 if (!inode_count[i]) { 1170 if (!inode_count[i]) {
1171 if (!inode_in_use(i)) 1171 if (!inode_in_use(i))
1172 continue; 1172 continue;
1173 printf("Inode %d not used, marked used in the bitmap.", i); 1173 printf("Unused inode %d is marked as 'used' in the bitmap. ", i);
1174 if (ask("Clear", 1)) 1174 if (ask("Clear", 1))
1175 unmark_inode(i); 1175 unmark_inode(i);
1176 continue; 1176 continue;
1177 } 1177 }
1178 if (!inode_in_use(i)) { 1178 if (!inode_in_use(i)) {
1179 printf("Inode %d used, marked unused in the bitmap.", i); 1179 printf("Inode %d is used, but marked as 'unused' in the bitmap. ", i);
1180 if (ask("Set", 1)) 1180 if (ask("Set", 1))
1181 mark_inode(i); 1181 mark_inode(i);
1182 } 1182 }
1183 if (Inode[i].i_nlinks != inode_count[i]) { 1183 if (Inode[i].i_nlinks != inode_count[i]) {
1184 printf("Inode %d (mode = %07o), i_nlinks=%d, counted=%d.", 1184 printf("Inode %d (mode=%07o), i_nlinks=%d, counted=%d. ",
1185 i, Inode[i].i_mode, Inode[i].i_nlinks, inode_count[i]); 1185 i, Inode[i].i_mode, Inode[i].i_nlinks, inode_count[i]);
1186 if (ask("Set i_nlinks to count", 1)) { 1186 if (ask("Set i_nlinks to count", 1)) {
1187 Inode[i].i_nlinks = inode_count[i]; 1187 Inode[i].i_nlinks = inode_count[i];
@@ -1195,7 +1195,7 @@ static void check_counts(void)
1195 if (!zone_count[i]) { 1195 if (!zone_count[i]) {
1196 if (bad_zone(i)) 1196 if (bad_zone(i))
1197 continue; 1197 continue;
1198 printf("Zone %d: marked in use, no file uses it.", i); 1198 printf("Zone %d is marked 'in use', but no file uses it. ", i);
1199 if (ask("Unmark", 1)) 1199 if (ask("Unmark", 1))
1200 unmark_zone(i); 1200 unmark_zone(i);
1201 continue; 1201 continue;
@@ -1212,7 +1212,7 @@ static void check_counts2(void)
1212 1212
1213 for (i = 1; i <= INODES; i++) { 1213 for (i = 1; i <= INODES; i++) {
1214 if (warn_mode && Inode2[i].i_mode && !inode_in_use(i)) { 1214 if (warn_mode && Inode2[i].i_mode && !inode_in_use(i)) {
1215 printf("Inode %d mode not cleared.", i); 1215 printf("Inode %d has non-zero mode. ", i);
1216 if (ask("Clear", 1)) { 1216 if (ask("Clear", 1)) {
1217 Inode2[i].i_mode = 0; 1217 Inode2[i].i_mode = 0;
1218 changed = 1; 1218 changed = 1;
@@ -1221,18 +1221,18 @@ static void check_counts2(void)
1221 if (!inode_count[i]) { 1221 if (!inode_count[i]) {
1222 if (!inode_in_use(i)) 1222 if (!inode_in_use(i))
1223 continue; 1223 continue;
1224 printf("Inode %d not used, marked used in the bitmap.", i); 1224 printf("Unused inode %d is marked as 'used' in the bitmap. ", i);
1225 if (ask("Clear", 1)) 1225 if (ask("Clear", 1))
1226 unmark_inode(i); 1226 unmark_inode(i);
1227 continue; 1227 continue;
1228 } 1228 }
1229 if (!inode_in_use(i)) { 1229 if (!inode_in_use(i)) {
1230 printf("Inode %d used, marked unused in the bitmap.", i); 1230 printf("Inode %d is used, but marked as 'unused' in the bitmap. ", i);
1231 if (ask("Set", 1)) 1231 if (ask("Set", 1))
1232 mark_inode(i); 1232 mark_inode(i);
1233 } 1233 }
1234 if (Inode2[i].i_nlinks != inode_count[i]) { 1234 if (Inode2[i].i_nlinks != inode_count[i]) {
1235 printf("Inode %d (mode = %07o), i_nlinks=%d, counted=%d.", 1235 printf("Inode %d (mode=%07o), i_nlinks=%d, counted=%d. ",
1236 i, Inode2[i].i_mode, Inode2[i].i_nlinks, 1236 i, Inode2[i].i_mode, Inode2[i].i_nlinks,
1237 inode_count[i]); 1237 inode_count[i]);
1238 if (ask("Set i_nlinks to count", 1)) { 1238 if (ask("Set i_nlinks to count", 1)) {
@@ -1247,7 +1247,7 @@ static void check_counts2(void)
1247 if (!zone_count[i]) { 1247 if (!zone_count[i]) {
1248 if (bad_zone(i)) 1248 if (bad_zone(i))
1249 continue; 1249 continue;
1250 printf("Zone %d: marked in use, no file uses it.", i); 1250 printf("Zone %d is marked 'in use', but no file uses it. ", i);
1251 if (ask("Unmark", 1)) 1251 if (ask("Unmark", 1))
1252 unmark_zone(i); 1252 unmark_zone(i);
1253 continue; 1253 continue;
@@ -1291,10 +1291,10 @@ int fsck_minix_main(int argc, char **argv)
1291#endif 1291#endif
1292 1292
1293 if (INODE_SIZE * MINIX_INODES_PER_BLOCK != BLOCK_SIZE) 1293 if (INODE_SIZE * MINIX_INODES_PER_BLOCK != BLOCK_SIZE)
1294 die("bad inode size"); 1294 die("Bad inode size");
1295#ifdef CONFIG_FEATURE_MINIX2 1295#ifdef CONFIG_FEATURE_MINIX2
1296 if (INODE_SIZE2 * MINIX2_INODES_PER_BLOCK != BLOCK_SIZE) 1296 if (INODE_SIZE2 * MINIX2_INODES_PER_BLOCK != BLOCK_SIZE)
1297 die("bad v2 inode size"); 1297 die("Bad v2 inode size");
1298#endif 1298#endif
1299 while (argc-- > 1) { 1299 while (argc-- > 1) {
1300 argv++; 1300 argv++;
@@ -1338,11 +1338,11 @@ int fsck_minix_main(int argc, char **argv)
1338 check_mount(); /* trying to check a mounted filesystem? */ 1338 check_mount(); /* trying to check a mounted filesystem? */
1339 if (repair && !automatic) { 1339 if (repair && !automatic) {
1340 if (!isatty(0) || !isatty(1)) 1340 if (!isatty(0) || !isatty(1))
1341 die("need terminal for interactive repairs"); 1341 die("Need terminal for interactive repairs");
1342 } 1342 }
1343 IN = open(device_name, repair ? O_RDWR : O_RDONLY); 1343 IN = open(device_name, repair ? O_RDWR : O_RDONLY);
1344 if (IN < 0){ 1344 if (IN < 0){
1345 fprintf(stderr,"unable to open device '%s'\n",device_name); 1345 printf("Unable to open device '%s'\n", device_name);
1346 leave(8); 1346 leave(8);
1347 } 1347 }
1348 sync(); /* paranoia? */ 1348 sync(); /* paranoia? */
@@ -1358,7 +1358,7 @@ int fsck_minix_main(int argc, char **argv)
1358 if (!(Super.s_state & MINIX_ERROR_FS) && 1358 if (!(Super.s_state & MINIX_ERROR_FS) &&
1359 (Super.s_state & MINIX_VALID_FS) && !force) { 1359 (Super.s_state & MINIX_VALID_FS) && !force) {
1360 if (repair) 1360 if (repair)
1361 printf("%s is clean, no check\n", device_name); 1361 printf("%s is clean, check is skipped\n", device_name);
1362 return retcode; 1362 return retcode;
1363 } else if (force) 1363 } else if (force)
1364 printf("Forcing filesystem check on %s\n", device_name); 1364 printf("Forcing filesystem check on %s\n", device_name);
@@ -1396,9 +1396,8 @@ int fsck_minix_main(int argc, char **argv)
1396 for (i = FIRSTZONE, free_cnt = 0; i < ZONES; i++) 1396 for (i = FIRSTZONE, free_cnt = 0; i < ZONES; i++)
1397 if (!zone_in_use(i)) 1397 if (!zone_in_use(i))
1398 free_cnt++; 1398 free_cnt++;
1399 printf("%6ld zones used (%ld%%)\n", (ZONES - free_cnt), 1399 printf("%6ld zones used (%ld%%)\n\n"
1400 100 * (ZONES - free_cnt) / ZONES); 1400 "%6d regular files\n"
1401 printf("\n%6d regular files\n"
1402 "%6d directories\n" 1401 "%6d directories\n"
1403 "%6d character device files\n" 1402 "%6d character device files\n"
1404 "%6d block device files\n" 1403 "%6d block device files\n"
@@ -1406,15 +1405,14 @@ int fsck_minix_main(int argc, char **argv)
1406 "%6d symbolic links\n" 1405 "%6d symbolic links\n"
1407 "------\n" 1406 "------\n"
1408 "%6d files\n", 1407 "%6d files\n",
1408 (ZONES - free_cnt), 100 * (ZONES - free_cnt) / ZONES,
1409 regular, directory, chardev, blockdev, 1409 regular, directory, chardev, blockdev,
1410 links - 2 * directory + 1, symlinks, 1410 links - 2 * directory + 1, symlinks,
1411 total - 2 * directory + 1); 1411 total - 2 * directory + 1);
1412 } 1412 }
1413 if (changed) { 1413 if (changed) {
1414 write_tables(); 1414 write_tables();
1415 printf("----------------------------\n" 1415 printf("FILE SYSTEM HAS BEEN CHANGED\n");
1416 "FILE SYSTEM HAS BEEN CHANGED\n"
1417 "----------------------------\n");
1418 sync(); 1416 sync();
1419 } else if (repair) 1417 } else if (repair)
1420 write_super_block(); 1418 write_super_block();