This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch andyp-fsck_cx in repository gfs2-utils.
commit 5a517177ccb19ffc89d0616fcefec8282813739a Author: Andrew Price anprice@redhat.com AuthorDate: Mon Aug 1 08:47:25 2022 +0100
fsck.gfs2: Move the global preen into fsck_options
Signed-off-by: Andrew Price anprice@redhat.com --- gfs2/fsck/fsck.h | 1 + gfs2/fsck/main.c | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/gfs2/fsck/fsck.h b/gfs2/fsck/fsck.h index 38b73529..603149b2 100644 --- a/gfs2/fsck/fsck.h +++ b/gfs2/fsck/fsck.h @@ -146,6 +146,7 @@ struct fsck_options { unsigned int yes:1; unsigned int no:1; unsigned int query:1; + unsigned int preen:1; };
extern struct fsck_options opts; diff --git a/gfs2/fsck/main.c b/gfs2/fsck/main.c index d980f864..0b5d2398 100644 --- a/gfs2/fsck/main.c +++ b/gfs2/fsck/main.c @@ -38,7 +38,6 @@ int dups_found = 0, dups_found_first = 0; int sb_fixed = 0; int print_level = MSG_NOTICE;
-static int preen = 0; static int force_check = 0; static const char *pass_name = "";
@@ -67,7 +66,7 @@ static int read_cmdline(int argc, char **argv, struct fsck_options *gopts) fprintf(stderr, _("Options -p/-a, -y and -n may not be used together\n")); return FSCK_USAGE; } - preen = 1; + gopts->preen = 1; gopts->yes = 1; break; case 'f': @@ -78,7 +77,7 @@ static int read_cmdline(int argc, char **argv, struct fsck_options *gopts) exit(FSCK_OK); break; case 'n': - if (gopts->yes || preen) { + if (gopts->yes || gopts->preen) { fprintf(stderr, _("Options -p/-a, -y and -n may not be used together\n")); return FSCK_USAGE; } @@ -95,7 +94,7 @@ static int read_cmdline(int argc, char **argv, struct fsck_options *gopts) exit(FSCK_OK); break; case 'y': - if (gopts->no || preen) { + if (gopts->no || gopts->preen) { fprintf(stderr, _("Options -p/-a, -y and -n may not be used together\n")); return FSCK_USAGE; } @@ -327,10 +326,10 @@ int main(int argc, char **argv) exit(error); setbuf(stdout, NULL); log_notice( _("Initializing fsck\n")); - if ((error = initialize(&cx, force_check, preen, &all_clean))) + if ((error = initialize(&cx, force_check, opts.preen, &all_clean))) exit(error);
- if (!force_check && all_clean && preen) { + if (!force_check && all_clean && opts.preen) { log_err( _("%s: clean.\n"), opts.device); destroy(&cx); exit(FSCK_OK);