Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/e2fsprogs/fsck.c
- Timestamp:
- Feb 25, 2011, 9:26:54 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi-busybox/e2fsprogs/fsck.c
r1765 r2725 21 21 * 2001, 2002, 2003, 2004, 2005 by Theodore Ts'o. 22 22 * 23 * %Begin-Header% 24 * This file may be redistributed under the terms of the GNU Public 25 * License. 26 * %End-Header% 23 * Licensed under GPLv2, see file LICENSE in this source tree. 27 24 */ 28 25 … … 40 37 #include "libbb.h" 41 38 39 /* "progress indicator" code is somewhat buggy and ext[23] specific. 40 * We should be filesystem agnostic. IOW: there should be a well-defined 41 * API for fsck.something, NOT ad-hoc hacks in generic fsck. */ 42 #define DO_PROGRESS_INDICATOR 0 43 44 /* fsck 1.41.4 (27-Jan-2009) manpage says: 45 * 0 - No errors 46 * 1 - File system errors corrected 47 * 2 - System should be rebooted 48 * 4 - File system errors left uncorrected 49 * 8 - Operational error 50 * 16 - Usage or syntax error 51 * 32 - Fsck canceled by user request 52 * 128 - Shared library error 53 */ 42 54 #define EXIT_OK 0 43 55 #define EXIT_NONDESTRUCT 1 … … 51 63 * Internal structure for mount table entries. 52 64 */ 53 54 65 struct fs_info { 55 66 struct fs_info *next; … … 58 69 char *type; 59 70 char *opts; 60 int freq;61 71 int passno; 62 72 int flags; … … 72 82 int pid; 73 83 int flags; 74 int exit_status; 84 #if DO_PROGRESS_INDICATOR 75 85 time_t start_time; 86 #endif 76 87 char *prog; 77 char *type;78 88 char *device; 79 89 char *base_device; /* /dev/hda for /dev/hdaN etc */ … … 103 113 #define BASE_MD "/dev/md" 104 114 105 static char **devices;106 115 static char **args; 107 static int num_devices;108 116 static int num_args; 109 117 static int verbose; … … 116 124 static smallint fs_type_negated; 117 125 118 static volatile smallint cancel_requested;119 static smallint doall;120 126 static smallint noexecute; 121 127 static smallint serialize; 122 128 static smallint skip_root; 123 129 /* static smallint like_mount; */ 124 static smallint notitle;125 130 static smallint parallel_root; 126 131 static smallint force_all_parallel; 127 132 128 /* "progress indicator" code is somewhat buggy and ext[23] specific.129 * We should be filesystem agnostic. IOW: there should be a well-defined130 * API for fsck.something, NOT ad-hoc hacks in generic fsck. */131 #define DO_PROGRESS_INDICATOR 0132 133 #if DO_PROGRESS_INDICATOR 133 134 static smallint progress; … … 169 170 int len; 170 171 #endif 171 cp = str = xstrdup(device); 172 173 /* Skip over /dev/; if it's not present, give up. */ 174 if (strncmp(cp, "/dev/", 5) != 0) 172 str = xstrdup(device); 173 174 /* Skip over "/dev/"; if it's not present, give up */ 175 cp = skip_dev_pfx(str); 176 if (cp == str) 175 177 goto errout; 176 cp += 5;177 178 178 179 /* … … 274 275 static struct fs_info *create_fs_device(const char *device, const char *mntpnt, 275 276 const char *type, const char *opts, 276 int freq, intpassno)277 int passno) 277 278 { 278 279 struct fs_info *fs; … … 281 282 fs->device = xstrdup(device); 282 283 fs->mountpt = xstrdup(mntpnt); 284 if (strchr(type, ',')) 285 type = (char *)"auto"; 283 286 fs->type = xstrdup(type); 284 287 fs->opts = xstrdup(opts ? opts : ""); 285 fs->freq = freq; 286 fs->passno = passno; 288 fs->passno = passno < 0 ? 1 : passno; 287 289 /*fs->flags = 0; */ 288 290 /*fs->next = NULL; */ … … 297 299 } 298 300 299 static void strip_line(char *line)300 {301 char *p = line + strlen(line) - 1;302 303 while (*line) {304 if (*p != '\n' && *p != '\r')305 break;306 *p-- = '\0';307 }308 }309 310 static char *parse_word(char **buf)311 {312 char *word, *next;313 314 word = *buf;315 if (*word == '\0')316 return NULL;317 318 word = skip_whitespace(word);319 next = skip_non_whitespace(word);320 if (*next)321 *next++ = '\0';322 *buf = next;323 return word;324 }325 326 static void parse_escape(char *word)327 {328 char *q, c;329 const char *p;330 331 if (!word)332 return;333 334 for (p = q = word; *p; q++) {335 c = *p++;336 if (c != '\\') {337 *q = c;338 } else {339 *q = bb_process_escape_sequence(&p);340 }341 }342 *q = '\0';343 }344 345 static int parse_fstab_line(char *line, struct fs_info **ret_fs)346 {347 char *device, *mntpnt, *type, *opts, *freq, *passno, *cp;348 struct fs_info *fs;349 350 *ret_fs = 0;351 strip_line(line);352 cp = strchr(line, '#');353 if (cp)354 *cp = '\0'; /* Ignore everything after the comment char */355 cp = line;356 357 device = parse_word(&cp);358 if (!device) return 0; /* Allow blank lines */359 mntpnt = parse_word(&cp);360 type = parse_word(&cp);361 opts = parse_word(&cp);362 freq = parse_word(&cp);363 passno = parse_word(&cp);364 365 if (!mntpnt || !type)366 return -1;367 368 parse_escape(device);369 parse_escape(mntpnt);370 parse_escape(type);371 parse_escape(opts);372 parse_escape(freq);373 parse_escape(passno);374 375 if (strchr(type, ','))376 type = NULL;377 378 fs = create_fs_device(device, mntpnt, type ? type : "auto", opts,379 freq ? atoi(freq) : -1,380 passno ? atoi(passno) : -1);381 *ret_fs = fs;382 return 0;383 }384 385 301 /* Load the filesystem database from /etc/fstab */ 386 302 static void load_fs_info(const char *filename) 387 303 { 388 FILE *f; 389 int lineno = 0; 390 int old_fstab = 1; 304 FILE *fstab; 305 struct mntent mte; 391 306 struct fs_info *fs; 392 307 393 f = fopen_or_warn(filename, "r"); 394 if (f == NULL) { 308 fstab = setmntent(filename, "r"); 309 if (!fstab) { 310 bb_perror_msg("can't read '%s'", filename); 395 311 return; 396 312 } 397 while (1) { 398 int r; 399 char *buf = xmalloc_getline(f); 400 if (!buf) break; 401 r = parse_fstab_line(buf, &fs); 402 free(buf); 403 lineno++; 404 if (r < 0) { 405 bb_error_msg("WARNING: bad format " 406 "on line %d of %s", lineno, filename); 407 continue; 408 } 409 if (!fs) 410 continue; 411 if (fs->passno < 0) 412 fs->passno = 0; 413 else 414 old_fstab = 0; 415 } 416 fclose(f); 417 418 if (old_fstab) { 419 fputs("\007" 420 "WARNING: Your /etc/fstab does not contain the fsck passno field.\n" 421 "I will kludge around things for you, but you should fix\n" 422 "your /etc/fstab file as soon as you can.\n\n", stderr); 423 for (fs = filesys_info; fs; fs = fs->next) { 424 fs->passno = 1; 425 } 426 } 313 314 // Loop through entries 315 while (getmntent_r(fstab, &mte, bb_common_bufsiz1, COMMON_BUFSIZE)) { 316 //bb_info_msg("CREATE[%s][%s][%s][%s][%d]", mte.mnt_fsname, mte.mnt_dir, 317 // mte.mnt_type, mte.mnt_opts, 318 // mte.mnt_passno); 319 fs = create_fs_device(mte.mnt_fsname, mte.mnt_dir, 320 mte.mnt_type, mte.mnt_opts, 321 mte.mnt_passno); 322 } 323 endmntent(fstab); 427 324 } 428 325 … … 461 358 * Send a signal to all outstanding fsck child processes 462 359 */ 463 static void kill_all_if_ cancel_requested(void)360 static void kill_all_if_got_signal(void) 464 361 { 465 362 static smallint kill_sent; … … 467 364 struct fsck_instance *inst; 468 365 469 if (! cancel_requested|| kill_sent)366 if (!bb_got_signal || kill_sent) 470 367 return; 471 368 … … 480 377 /* 481 378 * Wait for one child process to exit; when it does, unlink it from 482 * the list of executing child processes, and return it. 483 */ 484 static struct fsck_instance *wait_one(int flags) 379 * the list of executing child processes, free, and return its exit status. 380 * If there is no exited child, return -1. 381 */ 382 static int wait_one(int flags) 485 383 { 486 384 int status; … … 490 388 491 389 if (!instance_list) 492 return NULL; 493 494 if (noexecute) { 495 inst = instance_list; 496 prev = NULL; 497 #ifdef RANDOM_DEBUG 498 while (inst->next && (random() & 1)) { 499 prev = inst; 500 inst = inst->next; 501 } 502 #endif 503 inst->exit_status = 0; 504 goto ret_inst; 505 } 506 507 inst = prev = NULL; /* for gcc */ 508 do { 390 return -1; 391 /* if (noexecute) { already returned -1; } */ 392 393 while (1) { 509 394 pid = waitpid(-1, &status, flags); 510 kill_all_if_ cancel_requested();511 if (pid == 0 && (flags & WNOHANG))512 return NULL;395 kill_all_if_got_signal(); 396 if (pid == 0) /* flags == WNOHANG and no children exited */ 397 return -1; 513 398 if (pid < 0) { 514 if (errno == EINTR || errno == EAGAIN)399 if (errno == EINTR) 515 400 continue; 516 if (errno == ECHILD) { 517 bb_error_msg("wait: no more child process?!?");518 return NULL;401 if (errno == ECHILD) { /* paranoia */ 402 bb_error_msg("wait: no more children"); 403 return -1; 519 404 } 520 405 bb_perror_msg("wait"); … … 523 408 prev = NULL; 524 409 inst = instance_list; 525 while (inst){410 do { 526 411 if (inst->pid == pid) 527 break;412 goto child_died; 528 413 prev = inst; 529 414 inst = inst->next; 530 } 531 } while (!inst); 415 } while (inst); 416 } 417 child_died: 532 418 533 419 if (WIFEXITED(status)) … … 537 423 status = EXIT_UNCORRECTED; 538 424 if (sig != SIGINT) { 539 printf("Warning ... %s %s exited "540 " withsignal %d\n",425 printf("Warning: %s %s terminated " 426 "by signal %d\n", 541 427 inst->prog, inst->device, sig); 542 428 status = EXIT_ERROR; … … 547 433 status = EXIT_ERROR; 548 434 } 549 inst->exit_status = status;550 435 551 436 #if DO_PROGRESS_INDICATOR … … 576 461 #endif 577 462 578 ret_inst:579 463 if (prev) 580 464 prev->next = inst->next; … … 583 467 if (verbose > 1) 584 468 printf("Finished with %s (exit status %d)\n", 585 inst->device, inst->exit_status);469 inst->device, status); 586 470 num_running--; 587 return inst;588 } 589 590 #define FLAG_WAIT_ALL 0 591 #define FLAG_WAIT_ATLEAST_ONE 1 471 free_instance(inst); 472 473 return status; 474 } 475 592 476 /* 593 477 * Wait until all executing child processes have exited; return the 594 478 * logical OR of all of their exit code values. 595 479 */ 480 #define FLAG_WAIT_ALL 0 481 #define FLAG_WAIT_ATLEAST_ONE WNOHANG 596 482 static int wait_many(int flags) 597 483 { 598 struct fsck_instance *inst;484 int exit_status; 599 485 int global_status = 0; 600 486 int wait_flags = 0; 601 487 602 while ((inst = wait_one(wait_flags))) { 603 global_status |= inst->exit_status; 604 free_instance(inst); 605 #ifdef RANDOM_DEBUG 606 if (noexecute && (flags & WNOHANG) && !(random() % 3)) 607 break; 608 #endif 609 if (flags & FLAG_WAIT_ATLEAST_ONE) 610 wait_flags = WNOHANG; 488 while ((exit_status = wait_one(wait_flags)) != -1) { 489 global_status |= exit_status; 490 wait_flags |= flags; 611 491 } 612 492 return global_status; … … 617 497 * child processes we are waiting for. 618 498 */ 619 static void execute(const char *type, const char *device, const char *mntpt, 620 int interactive) 621 { 622 char *argv[num_args + 4]; /* see count below: */ 623 int argc; 499 static void execute(const char *type, const char *device, 500 const char *mntpt /*, int interactive */) 501 { 624 502 int i; 625 503 struct fsck_instance *inst; 626 504 pid_t pid; 627 505 628 inst = xzalloc(sizeof(*inst)); 629 630 argv[0] = xasprintf("fsck.%s", type); /* 1 */ 631 for (i = 0; i < num_args; i++) 632 argv[i+1] = args[i]; /* num_args */ 633 argc = num_args + 1; 506 args[0] = xasprintf("fsck.%s", type); 634 507 635 508 #if DO_PROGRESS_INDICATOR … … 638 511 || strcmp(type, "ext3") == 0 639 512 ) { 640 arg v[argc++] = xasprintf("-C%d", progress_fd); /* 1 */513 args[XXX] = xasprintf("-C%d", progress_fd); /* 1 */ 641 514 inst->flags |= FLAG_PROGRESS; 642 515 } … … 644 517 #endif 645 518 646 arg v[argc++] = xstrdup(device); /* 1 */647 argv[argc] = NULL; /* 1*/519 args[num_args - 2] = (char*)device; 520 /* args[num_args - 1] = NULL; - already is */ 648 521 649 522 if (verbose || noexecute) { 650 printf("[%s (%d) -- %s]", arg v[0], num_running,523 printf("[%s (%d) -- %s]", args[0], num_running, 651 524 mntpt ? mntpt : device); 652 for (i = 0; i < argc; i++)653 printf(" %s", arg v[i]);654 puts("");525 for (i = 0; args[i]; i++) 526 printf(" %s", args[i]); 527 bb_putchar('\n'); 655 528 } 656 529 … … 658 531 pid = -1; 659 532 if (!noexecute) { 660 pid = spawn(arg v);533 pid = spawn(args); 661 534 if (pid < 0) 662 bb_perror_msg("%s", argv[0]); 663 } 664 665 for (i = num_args+1; i < argc; i++) 666 free(argv[i]); 667 535 bb_simple_perror_msg(args[0]); 536 } 537 538 #if DO_PROGRESS_INDICATOR 539 free(args[XXX]); 540 #endif 541 542 /* No child, so don't record an instance */ 543 if (pid <= 0) { 544 free(args[0]); 545 return; 546 } 547 548 inst = xzalloc(sizeof(*inst)); 668 549 inst->pid = pid; 669 inst->prog = argv[0]; 670 inst->type = xstrdup(type); 550 inst->prog = args[0]; 671 551 inst->device = xstrdup(device); 672 552 inst->base_device = base_device(device); 553 #if DO_PROGRESS_INDICATOR 673 554 inst->start_time = time(NULL); 555 #endif 674 556 675 557 /* Add to the list of running fsck's. … … 689 571 * specified in /etc/fstab, or "auto". 690 572 */ 691 static void fsck_device(struct fs_info *fs , int interactive)573 static void fsck_device(struct fs_info *fs /*, int interactive */) 692 574 { 693 575 const char *type; … … 716 598 717 599 num_running++; 718 execute(type, fs->device, fs->mountpt , interactive);600 execute(type, fs->device, fs->mountpt /*, interactive */); 719 601 } 720 602 … … 868 750 * filesystem types (done as a side-effect of calling ignore()). 869 751 */ 870 for (fs = filesys_info; fs; fs = fs->next) {752 for (fs = filesys_info; fs; fs = fs->next) 871 753 if (ignore(fs)) 872 754 fs->flags |= FLAG_DONE; 873 }874 755 875 756 /* … … 878 759 if (!parallel_root) { 879 760 for (fs = filesys_info; fs; fs = fs->next) { 880 if (LONE_CHAR(fs->mountpt, '/')) 881 break;882 }883 if (fs) {884 if (!skip_root && !ignore(fs)) {885 fsck_device(fs, 1);886 status |= wait_many(FLAG_WAIT_ALL);887 if (status > EXIT_NONDESTRUCT)888 return status;761 if (LONE_CHAR(fs->mountpt, '/')) { 762 if (!skip_root && !ignore(fs)) { 763 fsck_device(fs /*, 1*/); 764 status |= wait_many(FLAG_WAIT_ALL); 765 if (status > EXIT_NONDESTRUCT) 766 return status; 767 } 768 fs->flags |= FLAG_DONE; 769 break; 889 770 } 890 fs->flags |= FLAG_DONE;891 771 } 892 772 } 893 773 /* 894 * This is for the bone-headed user who enters the root 895 * filesystem twice. Skip root will skip all root entries. 774 * This is for the bone-headed user who has root 775 * filesystem listed twice. 776 * "Skip root" will skip _all_ root entries. 896 777 */ 897 778 if (skip_root) … … 907 788 908 789 for (fs = filesys_info; fs; fs = fs->next) { 909 if ( cancel_requested)790 if (bb_got_signal) 910 791 break; 911 792 if (fs->flags & FLAG_DONE) … … 913 794 /* 914 795 * If the filesystem's pass number is higher 915 * than the current pass number, then we d on't796 * than the current pass number, then we didn't 916 797 * do it yet. 917 798 */ … … 932 813 * Spawn off the fsck process 933 814 */ 934 fsck_device(fs , serialize);815 fsck_device(fs /*, serialize*/); 935 816 fs->flags |= FLAG_DONE; 936 817 … … 947 828 } 948 829 } 949 if ( cancel_requested)830 if (bb_got_signal) 950 831 break; 951 832 if (verbose > 1) … … 960 841 not_done_yet = 1; 961 842 } 962 kill_all_if_ cancel_requested();843 kill_all_if_got_signal(); 963 844 status |= wait_many(FLAG_WAIT_ATLEAST_ONE); 964 845 return status; … … 976 857 smallint negate; 977 858 978 if (fs_type) { 979 s = fs_type; 980 while ((s = strchr(s, ','))) { 981 num++; 982 s++; 983 } 859 s = fs_type; 860 while ((s = strchr(s, ','))) { 861 num++; 862 s++; 984 863 } 985 864 … … 987 866 fs_type_flag = xzalloc(num * sizeof(fs_type_flag[0])); 988 867 fs_type_negated = -1; /* not yet known is it negated or not */ 989 990 if (!fs_type)991 return;992 868 993 869 num = 0; … … 1028 904 } 1029 905 1030 static void parse_args(int argc, char **argv) 1031 { 1032 int i, j; 1033 char *arg, *tmp; 1034 char *options = NULL; 1035 int optpos = 0; 1036 int opts_for_fsck = 0; 1037 1038 /* in bss, so already zeroed 906 static char **new_args(void) 907 { 908 args = xrealloc_vector(args, 2, num_args); 909 return &args[num_args++]; 910 } 911 912 int fsck_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 913 int fsck_main(int argc UNUSED_PARAM, char **argv) 914 { 915 int i, status; 916 /*int interactive;*/ 917 struct fs_info *fs; 918 const char *fstab; 919 char *tmp; 920 char **devices; 921 int num_devices; 922 smallint opts_for_fsck; 923 smallint doall; 924 smallint notitle; 925 926 /* we want wait() to be interruptible */ 927 signal_no_SA_RESTART_empty_mask(SIGINT, record_signo); 928 signal_no_SA_RESTART_empty_mask(SIGTERM, record_signo); 929 930 setbuf(stdout, NULL); 931 932 opts_for_fsck = doall = notitle = 0; 933 devices = NULL; 1039 934 num_devices = 0; 1040 num_args = 0; 1041 instance_list = NULL; 1042 */ 1043 1044 /* TODO: getopt32 */ 1045 for (i = 1; i < argc; i++) { 1046 arg = argv[i]; 935 new_args(); /* args[0] = NULL, will be replaced by fsck.<type> */ 936 /* instance_list = NULL; - in bss, so already zeroed */ 937 938 while (*++argv) { 939 int j; 940 int optpos; 941 char *options; 942 char *arg = *argv; 1047 943 1048 944 /* "/dev/blk" or "/path" or "UUID=xxx" or "LABEL=xxx" */ … … 1051 947 // "/path", "UUID=xxx" or "LABEL=xxx" into block device name 1052 948 // ("UUID=xxx"/"LABEL=xxx" can probably shifted to fsck.auto duties) 1053 devices = xrealloc (devices, (num_devices+1) * sizeof(devices[0]));1054 devices[num_devices++] = xstrdup(arg);949 devices = xrealloc_vector(devices, 2, num_devices); 950 devices[num_devices++] = arg; 1055 951 continue; 1056 952 } 1057 953 1058 954 if (arg[0] != '-' || opts_for_fsck) { 1059 args = xrealloc(args, (num_args+1) * sizeof(args[0])); 1060 args[num_args++] = xstrdup(arg); 955 *new_args() = arg; 1061 956 continue; 1062 957 } 1063 958 959 if (LONE_CHAR(arg + 1, '-')) { /* "--" ? */ 960 opts_for_fsck = 1; 961 continue; 962 } 963 964 optpos = 0; 965 options = NULL; 1064 966 for (j = 1; arg[j]; j++) { 1065 if (opts_for_fsck) {1066 optpos++;1067 /* one extra for '\0' */1068 options = xrealloc(options, optpos + 2);1069 options[optpos] = arg[j];1070 continue;1071 }1072 967 switch (arg[j]) { 1073 968 case 'A': … … 1078 973 progress = 1; 1079 974 if (arg[++j]) { /* -Cn */ 1080 progress_fd = xatoi_ u(&arg[j]);975 progress_fd = xatoi_positive(&arg[j]); 1081 976 goto next_arg; 1082 977 } 1083 978 /* -C n */ 1084 progress_fd = xatoi_u(argv[++i]); 979 if (!*++argv) 980 bb_show_usage(); 981 progress_fd = xatoi_positive(*argv); 1085 982 goto next_arg; 1086 983 #endif … … 1111 1008 if (arg[++j]) 1112 1009 tmp = &arg[j]; 1113 else if ( ++i < argc)1114 tmp = argv[i];1010 else if (*++argv) 1011 tmp = *argv; 1115 1012 else 1116 1013 bb_show_usage(); … … 1118 1015 compile_fs_type(fstype); 1119 1016 goto next_arg; 1120 case '-':1121 opts_for_fsck++;1122 break;1123 1017 case '?': 1124 1018 bb_show_usage(); … … 1136 1030 options[0] = '-'; 1137 1031 options[optpos + 1] = '\0'; 1138 args = xrealloc(args, (num_args+1) * sizeof(args[0])); 1139 args[num_args++] = options; 1140 optpos = 0; 1141 options = NULL; 1032 *new_args() = options; 1142 1033 } 1143 1034 } … … 1147 1038 if (tmp) 1148 1039 max_running = xatoi(tmp); 1149 } 1150 1151 static void signal_cancel(int sig ATTRIBUTE_UNUSED) 1152 { 1153 cancel_requested = 1; 1154 } 1155 1156 int fsck_main(int argc, char **argv); 1157 int fsck_main(int argc, char **argv) 1158 { 1159 int i, status = 0; 1160 int interactive; 1161 const char *fstab; 1162 struct fs_info *fs; 1163 struct sigaction sa; 1164 1165 memset(&sa, 0, sizeof(sa)); 1166 sa.sa_handler = signal_cancel; 1167 sigaction(SIGINT, &sa, 0); 1168 sigaction(SIGTERM, &sa, 0); 1169 1170 setbuf(stdout, NULL); 1171 1172 parse_args(argc, argv); 1040 new_args(); /* args[num_args - 2] will be replaced by <device> */ 1041 new_args(); /* args[num_args - 1] is the last, NULL element */ 1173 1042 1174 1043 if (!notitle) … … 1182 1051 load_fs_info(fstab); 1183 1052 1184 interactive = (num_devices == 1) | serialize; 1185 1186 /* If -A was specified ("check all"), do that! */ 1053 /*interactive = (num_devices == 1) | serialize;*/ 1054 1055 if (num_devices == 0) 1056 /*interactive =*/ serialize = doall = 1; 1187 1057 if (doall) 1188 1058 return check_all(); 1189 1059 1190 if (num_devices == 0) { 1191 serialize = 1; 1192 interactive = 1; 1193 return check_all(); 1194 } 1195 1060 status = 0; 1196 1061 for (i = 0; i < num_devices; i++) { 1197 if ( cancel_requested) {1198 kill_all_if_ cancel_requested();1062 if (bb_got_signal) { 1063 kill_all_if_got_signal(); 1199 1064 break; 1200 1065 } … … 1202 1067 fs = lookup(devices[i]); 1203 1068 if (!fs) 1204 fs = create_fs_device(devices[i], 0, "auto", 0, -1, -1);1205 fsck_device(fs , interactive);1069 fs = create_fs_device(devices[i], "", "auto", NULL, -1); 1070 fsck_device(fs /*, interactive */); 1206 1071 1207 1072 if (serialize 1208 1073 || (max_running && (num_running >= max_running)) 1209 1074 ) { 1210 struct fsck_instance *inst; 1211 1212 inst = wait_one(0); 1213 if (inst) { 1214 status |= inst->exit_status; 1215 free_instance(inst); 1216 } 1075 int exit_status = wait_one(0); 1076 if (exit_status >= 0) 1077 status |= exit_status; 1217 1078 if (verbose > 1) 1218 1079 puts("----------------------------------");
Note:
See TracChangeset
for help on using the changeset viewer.