From ce619e69ffa47fb8c8caeb952d826a13450df130 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Mon, 29 Jul 2024 16:23:13 -0700 Subject: [PATCH] xfs_scrub: don't close stdout when closing the progress bar When we're tearing down the progress bar file stream, check that it's not an alias of stdout before closing it. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- scrub/xfs_scrub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scrub/xfs_scrub.c b/scrub/xfs_scrub.c index edf58d07..adf9d13e 100644 --- a/scrub/xfs_scrub.c +++ b/scrub/xfs_scrub.c @@ -878,7 +878,7 @@ out: if (ctx.runtime_errors) ret |= SCRUB_RET_OPERROR; phase_end(&all_pi, 0); - if (progress_fp) + if (progress_fp && fileno(progress_fp) != 1) fclose(progress_fp); out_unicrash: unicrash_unload(); -- 2.47.2