]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Fix stderr progress logging for decompression 2982/head
authorNick Terrell <terrelln@fb.com>
Fri, 7 Jan 2022 23:09:56 +0000 (15:09 -0800)
committerNick Terrell <terrelln@fb.com>
Fri, 7 Jan 2022 23:09:56 +0000 (15:09 -0800)
When decompressing with `-q` and an output file, the progress bar was mistakenly printed. This is a minimal fix, with a larger refactor to be stacked on top of it.

Fixes #2967.

programs/fileio.c

index 379d334eb02077b730a99e92214c3649b4116395..89eecb9e7d78001eba886d29e4d0a9fa2b47a681 100644 (file)
@@ -2245,7 +2245,7 @@ FIO_decompressZstdFrame(FIO_ctx_t* const fCtx, dRess_t* ress, FILE* finput,
         ZSTD_inBuffer  inBuff = { ress->srcBuffer, ress->srcBufferLoaded, 0 };
         ZSTD_outBuffer outBuff= { ress->dstBuffer, ress->dstBufferSize, 0 };
         size_t const readSizeHint = ZSTD_decompressStream(ress->dctx, &outBuff, &inBuff);
-        const int displayLevel = (!fCtx->hasStdoutOutput || g_display_prefs.progressSetting == FIO_ps_always) ? 1 : 2;
+        const int displayLevel = (g_display_prefs.progressSetting == FIO_ps_always) ? 1 : 2;
         UTIL_HumanReadableSize_t const hrs = UTIL_makeHumanReadableSize(alreadyDecoded+frameSize);
         if (ZSTD_isError(readSizeHint)) {
             DISPLAYLEVEL(1, "%s : Decoding error (36) : %s \n",