diff --git a/src/basic/mkdir.c b/src/basic/mkdir.c index 20329e04c2..f87de0a2bf 100644 --- a/src/basic/mkdir.c +++ b/src/basic/mkdir.c @@ -259,7 +259,7 @@ int mkdir_p_root_full(const char *root, const char *p, uid_t uid, gid_t gid, mod struct timespec tspec; timespec_store(&tspec, ts); - if (futimens(dfd, (const struct timespec[2]) { { .tv_nsec = UTIME_OMIT }, tspec }) < 0) + if (futimens(dfd, (const struct timespec[2]) { TIMESPEC_OMIT, tspec }) < 0) return -errno; if (futimens(nfd, (const struct timespec[2]) { tspec, tspec }) < 0) diff --git a/src/basic/time-util.h b/src/basic/time-util.h index b28ab8242f..f273770233 100644 --- a/src/basic/time-util.h +++ b/src/basic/time-util.h @@ -75,6 +75,8 @@ typedef enum TimestampStyle { #define DUAL_TIMESTAMP_INFINITY ((dual_timestamp) { USEC_INFINITY, USEC_INFINITY }) #define TRIPLE_TIMESTAMP_NULL ((triple_timestamp) {}) +#define TIMESPEC_OMIT ((const struct timespec) { .tv_nsec = UTIME_OMIT }) + usec_t now(clockid_t clock); nsec_t now_nsec(clockid_t clock); diff --git a/src/partition/repart.c b/src/partition/repart.c index 4196576daa..7f7b68f9ff 100644 --- a/src/partition/repart.c +++ b/src/partition/repart.c @@ -4936,7 +4936,7 @@ static int do_copy_files(Context *context, Partition *p, const char *root) { struct timespec tspec; timespec_store(&tspec, ts); - if (futimens(pfd, (const struct timespec[2]) { { .tv_nsec = UTIME_OMIT }, tspec }) < 0) + if (futimens(pfd, (const struct timespec[2]) { TIMESPEC_OMIT, tspec }) < 0) return -errno; } }