From a749e257f30ea020f42912e9afd63aedfeb26dc5 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Fri, 18 Aug 2017 12:00:00 -0500 Subject: [PATCH] xfs_db: reset metadump output flag On the off chance that someone runs metadump more than once with the metadump file going to stdout and then not stdout, the stdout_metadump variable will not be reset before the second invocation. Clear the status variable when we undo the stdout redirection. Fixes-coverity-id: 1416140 Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen Signed-off-by: Eric Sandeen --- db/metadump.c | 1 + 1 file changed, 1 insertion(+) diff --git a/db/metadump.c b/db/metadump.c index 3967df645..6dd06c302 100644 --- a/db/metadump.c +++ b/db/metadump.c @@ -2934,6 +2934,7 @@ metadump_f( ret = dup2(outfd, STDOUT_FILENO); if (ret < 0) perror("un-redirecting stdout"); + stdout_metadump = false; } fclose(outf); -- 2.47.2