]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_db: reset metadump output flag
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 18 Aug 2017 17:00:00 +0000 (12:00 -0500)
committerEric Sandeen <sandeen@redhat.com>
Fri, 18 Aug 2017 17:00:00 +0000 (12:00 -0500)
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 <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
db/metadump.c

index 3967df64588029decaaf86a42cd2a29b74fb1b78..6dd06c302a6666e4b06982656a1afbb6850358c1 100644 (file)
@@ -2934,6 +2934,7 @@ metadump_f(
                ret = dup2(outfd, STDOUT_FILENO);
                if (ret < 0)
                        perror("un-redirecting stdout");
+               stdout_metadump = false;
        }
        fclose(outf);