diff options
author | Nick Terrell <terrelln@fb.com> | 2022-01-18 15:14:06 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-18 15:14:06 -0800 |
commit | 3369a106ebb5f6572fd123aaf55b33cfa51227cd (patch) | |
tree | 1a5ed20ee4d377e1c34dea1128f7a0ca753c0d31 | |
parent | fe8fefb28d3773a7d1e01ecf8c7613a60951ffb9 (diff) | |
parent | 57a86d9ec636c75f17a3005962ff178545e404f5 (diff) | |
download | zstd-3369a106ebb5f6572fd123aaf55b33cfa51227cd.tar.gz |
Merge pull request #2998 from floppym/issue2997
Avoid updating timestamps when the destination is stdout
-rw-r--r-- | programs/fileio.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/programs/fileio.c b/programs/fileio.c index 89eecb9e..5338fa62 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -1679,6 +1679,7 @@ static int FIO_compressFilename_dstFile(FIO_ctx_t* const fCtx, if (ress.dstFile == NULL) { int dstFilePermissions = DEFAULT_FILE_PERMISSIONS; if ( strcmp (srcFileName, stdinmark) + && strcmp (dstFileName, stdoutmark) && UTIL_stat(srcFileName, &statbuf) && UTIL_isRegularFileStat(&statbuf) ) { dstFilePermissions = statbuf.st_mode; @@ -2634,6 +2635,7 @@ static int FIO_decompressDstFile(FIO_ctx_t* const fCtx, if ((ress.dstFile == NULL) && (prefs->testMode==0)) { int dstFilePermissions = DEFAULT_FILE_PERMISSIONS; if ( strcmp(srcFileName, stdinmark) /* special case : don't transfer permissions from stdin */ + && strcmp(dstFileName, stdoutmark) && UTIL_stat(srcFileName, &statbuf) && UTIL_isRegularFileStat(&statbuf) ) { dstFilePermissions = statbuf.st_mode; |