int closeDstFile = 0;
int result;
stat_t statbuf;
+ int transferMTime = 0;
assert(ress.srcFile != NULL);
if (ress.dstFile == NULL) {
int dstFilePermissions = DEFAULT_FILE_PERMISSIONS;
&& UTIL_stat(srcFileName, &statbuf)
&& UTIL_isRegularFileStat(&statbuf) ) {
dstFilePermissions = statbuf.st_mode;
+ transferMTime = 1;
}
closeDstFile = 1;
DISPLAYLEVEL(1, "zstd: %s: %s \n", dstFileName, strerror(errno));
result=1;
}
+ if (transferMTime) {
+ UTIL_utime(dstFileName, &statbuf);
+ }
if ( (result != 0) /* operation failure */
&& strcmp(dstFileName, stdoutmark) /* special case : don't remove() stdout */
) {
int result;
stat_t statbuf;
int releaseDstFile = 0;
+ int transferMTime = 0;
if ((ress.dstFile == NULL) && (prefs->testMode==0)) {
int dstFilePermissions = DEFAULT_FILE_PERMISSIONS;
&& UTIL_stat(srcFileName, &statbuf)
&& UTIL_isRegularFileStat(&statbuf) ) {
dstFilePermissions = statbuf.st_mode;
+ transferMTime = 1;
}
releaseDstFile = 1;
result = 1;
}
+ if (transferMTime) {
+ UTIL_utime(dstFileName, &statbuf);
+ }
+
if ( (result != 0) /* operation failure */
&& strcmp(dstFileName, stdoutmark) /* special case : don't remove() stdout */
) {