From: Darrick J. Wong Date: Fri, 18 Aug 2017 17:00:00 +0000 (-0500) Subject: xfs_db: reset metadump output flag X-Git-Tag: v4.13.0-rc1~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a749e257f30ea020f42912e9afd63aedfeb26dc5;p=thirdparty%2Fxfsprogs-dev.git 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 --- 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);