mirror of
https://github.com/systemd/systemd
synced 2024-07-21 18:24:38 +00:00
repart: correct timespec_store usage too
This commit is contained in:
parent
158681f0f9
commit
8aed85875d
|
@ -4898,7 +4898,6 @@ static int do_copy_files(Context *context, Partition *p, const char *root) {
|
|||
strempty(arg_copy_source), *source, strempty(root), *target);
|
||||
} else {
|
||||
_cleanup_free_ char *dn = NULL, *fn = NULL;
|
||||
struct timespec tspec;
|
||||
|
||||
/* We are looking at a regular file */
|
||||
|
||||
|
@ -4933,10 +4932,13 @@ static int do_copy_files(Context *context, Partition *p, const char *root) {
|
|||
(void) copy_access(sfd, tfd);
|
||||
(void) copy_times(sfd, tfd, 0);
|
||||
|
||||
timespec_store_nsec(&tspec, ts);
|
||||
if (ts != USEC_INFINITY) {
|
||||
struct timespec tspec;
|
||||
timespec_store(&tspec, ts);
|
||||
|
||||
if (ts != USEC_INFINITY && futimens(pfd, (const struct timespec[2]) { { .tv_nsec = UTIME_OMIT }, tspec }) < 0)
|
||||
return -errno;
|
||||
if (futimens(pfd, (const struct timespec[2]) { { .tv_nsec = UTIME_OMIT }, tspec }) < 0)
|
||||
return -errno;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue