When gzipping to a target file, only set the source file flags on the
target file after the timestamp has been set; otherwise setting the timestamp will fail if the flags don't permit it (i.e., uchg). MFC after: 1 week PR: 120208 Submitted by: Ighighi <ighighi at gmail.com>
This commit is contained in:
parent
593e717ec9
commit
c7b65254c4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=176970
@ -1075,14 +1075,14 @@ copymodes(int fd, const struct stat *sbp, const char *file)
|
|||||||
if (fchmod(fd, sb.st_mode) < 0)
|
if (fchmod(fd, sb.st_mode) < 0)
|
||||||
maybe_warn("couldn't fchmod: %s", file);
|
maybe_warn("couldn't fchmod: %s", file);
|
||||||
|
|
||||||
/* only try flags if they exist already */
|
|
||||||
if (sb.st_flags != 0 && fchflags(fd, sb.st_flags) < 0)
|
|
||||||
maybe_warn("couldn't fchflags: %s", file);
|
|
||||||
|
|
||||||
TIMESPEC_TO_TIMEVAL(×[0], &sb.st_atimespec);
|
TIMESPEC_TO_TIMEVAL(×[0], &sb.st_atimespec);
|
||||||
TIMESPEC_TO_TIMEVAL(×[1], &sb.st_mtimespec);
|
TIMESPEC_TO_TIMEVAL(×[1], &sb.st_mtimespec);
|
||||||
if (futimes(fd, times) < 0)
|
if (futimes(fd, times) < 0)
|
||||||
maybe_warn("couldn't utimes: %s", file);
|
maybe_warn("couldn't utimes: %s", file);
|
||||||
|
|
||||||
|
/* only try flags if they exist already */
|
||||||
|
if (sb.st_flags != 0 && fchflags(fd, sb.st_flags) < 0)
|
||||||
|
maybe_warn("couldn't fchflags: %s", file);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user