From ee9229993a0bb078c17738e91d7aa7864be5a17b Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 16 Jan 1999 05:39:12 +0000 Subject: [PATCH] ChangeLog, fsck.c: 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 | 10 ++++++++++ misc/fsck.c | 19 ++++++++++++++----- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/misc/ChangeLog b/misc/ChangeLog index 58e3eb6..963bf0a 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,13 @@ +1999-01-16 Theodore Ts'o + + * 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 * Release of E2fsprogs 1.14 diff --git a/misc/fsck.c b/misc/fsck.c index 30b7426..50f8f7c 100644 --- a/misc/fsck.c +++ b/misc/fsck.c @@ -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 -- 1.8.3.1