Use File Descriptor in Setting Stat on Output File
Note that the `fd` is only valid while the file is still open. So we need to move the setting calls to before we close the file. However! We cannot do so with the `utime()` call (even though `futimens()` exists) because the follow- ing `close()` call to the `fd` will reset the atime of the file. So it seems the `utime()` call has to happen after the file is closed.
This commit is contained in:
@@ -295,9 +295,6 @@ int UTIL_setFDStat(const int fd, const char *filename, const stat_t *statbuf)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* set access and modification times */
|
||||
res += UTIL_utime(filename, statbuf);
|
||||
|
||||
/* Mimic gzip's behavior:
|
||||
*
|
||||
* "Change the group first, then the permissions, then the owner.
|
||||
|
||||
Reference in New Issue
Block a user