Whamcloud - gitweb
ChangeLog, fsck.c:
authorTheodore Ts'o <tytso@mit.edu>
Sat, 16 Jan 1999 05:39:12 +0000 (05:39 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 16 Jan 1999 05:39:12 +0000 (05:39 +0000)
  fsck.c (execute, wait_one): Modified routines so that they accurately
  create an fsck_instance even when the noexecute flag is set.  This
  allows for accurate debugging of the fsck pass structure.
  (check_all): When the verbose flag is given twice, print debugging
  information about when fsck is waiting for jobs to finish.

misc/ChangeLog
misc/fsck.c

index 58e3eb6..963bf0a 100644 (file)
@@ -1,3 +1,13 @@
+1999-01-16  Theodore Ts'o  <tytso@rsts-11.mit.edu>
+
+       * fsck.c (execute, wait_one): Modified routines so that they
+               accurately create an fsck_instance even when the noexecute
+               flag is set.  This allows for accurate debugging of the
+               fsck pass structure.
+               (check_all): When the verbose flag is given twice, print
+               debugging information about when fsck is waiting for jobs
+               to finish.
+
 1999-01-09  Theodore Ts'o  <tytso@rsts-11.mit.edu>
 
        * Release of E2fsprogs 1.14
index 30b7426..50f8f7c 100644 (file)
@@ -367,11 +367,11 @@ static int execute(char *prog, char *device, char *mntpt)
                        printf("%s ", argv[i]);
                printf("\n");
        }
-       if (noexecute)
-               return 0;
        
        /* Fork and execute the correct program. */
-       if ((pid = fork()) < 0) {
+       if (noexecute)
+               pid = -1;
+       else if ((pid = fork()) < 0) {
                perror("fork");
                return errno;
        } else if (pid == 0) {
@@ -406,6 +406,13 @@ static struct fsck_instance *wait_one(NOARGS)
        if (!instance_list)
                return NULL;
 
+       if (noexecute) {
+               inst = instance_list;
+               instance_list = inst->next;
+               inst->exit_status = 0;
+               return(inst);
+       }
+
 retry:
        pid = wait(&status);
        if (pid < 0) {
@@ -621,7 +628,7 @@ static int check_all(NOARGS)
        struct fsck_instance *inst;
        int status = EXIT_OK;
        int not_done_yet = 1;
-       int passno = 0;
+       int passno = 1;
        int pass_done;
 
        if (verbose)
@@ -690,6 +697,8 @@ static int check_all(NOARGS)
 
                        }
                }
+               if (verbose > 1)
+                       printf("--waiting-- (pass %d)\n", passno);
                inst = wait_one();
                if (inst) {
                        status |= inst->exit_status;
@@ -697,7 +706,7 @@ static int check_all(NOARGS)
                }
                if (pass_done) {
                        status |= wait_all();
-                       if (verbose) 
+                       if (verbose > 1
                                printf("----------------------------------\n");
                        passno++;
                } else