summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/journal/journal-file.c2
-rw-r--r--src/shared/util.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index c20af5d9bf..c1b54046f9 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -2623,7 +2623,7 @@ int journal_file_open(
* attributes are not supported we'll just skip this,
* and rely solely on mtime/atime/ctime of the file. */
- fd_setcrtime(f->fd, now(CLOCK_REALTIME));
+ fd_setcrtime(f->fd, 0);
#ifdef HAVE_GCRYPT
/* Try to load the FSPRG state, and if we can't, then
diff --git a/src/shared/util.c b/src/shared/util.c
index 88fd78ec8d..7d753e448a 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -7670,6 +7670,9 @@ int fd_setcrtime(int fd, usec_t usec) {
assert(fd >= 0);
+ if (usec <= 0)
+ usec = now(CLOCK_REALTIME);
+
le = htole64((uint64_t) usec);
if (fsetxattr(fd, "user.crtime_usec", &le, sizeof(le), 0) < 0)
return -errno;