]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_db: redirect printfs when metadumping to stdout
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 20 Jul 2017 15:51:37 +0000 (10:51 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 20 Jul 2017 15:51:37 +0000 (10:51 -0500)
commit4944defad4ae2cbcf056207490d7c597bb92cd7c
treee57f816b648efbab5a1d3de21ff0668f37a2f957
parent746d40a73162f942f63f6a2f612f491d107b9824
xfs_db: redirect printfs when metadumping to stdout

If we're metadumping to stdout, we don't want xfs_db's various dbprintf
statements dumping to stdout because that'll corrupt the metadump.
Therefore, let outf point to the existing stdout and redirect stdout to
stderr for the duration of the dump operation.

Reported-by: David Shaw <dshaw@jabberwocky.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
db/metadump.c