]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_db: fix metadump redirection (again)
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 4 Aug 2017 21:33:51 +0000 (16:33 -0500)
committerEric Sandeen <sandeen@redhat.com>
Fri, 4 Aug 2017 21:33:51 +0000 (16:33 -0500)
commit449df236a703d8b03555874e5d530ecb8f34c7d5
treebaf558db6a5009b065ea766b4397c997033d4aa4
parent5a707ca152dc4400f0e069e3ef3bfd557552d752
xfs_db: fix metadump redirection (again)

In patch 4944defad4 ("xfs_db: redirect printfs when metadumping to
stdout"), we solved the problem of xfs_db printfs ending up in the
metadump stream by reassigning stdout for the duration of a stdout
metadump.  Unfortunately, musl doesn't allow stdout to be reassigned (in
their view "extern FILE *stdout" means "extern FILE * const stdout"), so
we abandon the old approach in favor of playing games with dup() to
switch the raw file descriptors.

While we're at it, fix a regression where an unconverted outf test
allows progress info to end up in the metadump stream.

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