diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2019-11-01 17:55:06 -0400 |
---|---|---|
committer | Eric Sandeen <sandeen@sandeen.net> | 2019-11-01 17:55:06 -0400 |
commit | 5155653f70bc87fcb8d14320e17c311e502e7388 (patch) | |
tree | 63b0d2d643a0ca91e2900053d948f73a2c66fb08 | |
parent | e98616ba9dc9bc457dcc111f97b33a88c6221850 (diff) | |
download | xfsprogs-dev-5155653f70bc87fcb8d14320e17c311e502e7388.tar.gz |
xfs_scrub: simplify post-run reporting logic
Simplify the post-run error and warning reporting logic so that in
subsequent patches we can be more specific about what types of things
went wrong.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
-rw-r--r-- | scrub/xfs_scrub.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/scrub/xfs_scrub.c b/scrub/xfs_scrub.c index e9fc3650de..c730569450 100644 --- a/scrub/xfs_scrub.c +++ b/scrub/xfs_scrub.c @@ -516,24 +516,20 @@ report_outcome( total_errors = ctx->errors_found + ctx->runtime_errors; if (total_errors == 0 && ctx->warnings_found == 0) { - log_info(ctx, _("No errors found.")); + log_info(ctx, _("No problems found.")); return; } - if (total_errors == 0) { - fprintf(stderr, _("%s: warnings found: %llu\n"), ctx->mntpoint, - ctx->warnings_found); - log_warn(ctx, _("warnings found: %llu"), ctx->warnings_found); - } else if (ctx->warnings_found == 0) { + if (total_errors > 0) { fprintf(stderr, _("%s: errors found: %llu\n"), ctx->mntpoint, total_errors); log_err(ctx, _("errors found: %llu"), total_errors); - } else { - fprintf(stderr, _("%s: errors found: %llu; warnings found: %llu\n"), - ctx->mntpoint, total_errors, + } + + if (ctx->warnings_found > 0) { + fprintf(stderr, _("%s: warnings found: %llu\n"), ctx->mntpoint, ctx->warnings_found); - log_err(ctx, _("errors found: %llu; warnings found: %llu"), - total_errors, ctx->warnings_found); + log_warn(ctx, _("warnings found: %llu"), ctx->warnings_found); } /* |