Skip to content

Commit

Permalink
mailbox.c: store nanoseconds on message file mtimes
Browse files Browse the repository at this point in the history
  • Loading branch information
ksmurchison committed Dec 18, 2024
1 parent fc76ab8 commit f5d578d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions imap/mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -4633,7 +4633,7 @@ EXPORTED int mailbox_append_index_record(struct mailbox *mailbox,
struct index_record *record)
{
int r;
struct utimbuf settime;
struct timespec settime[2];
uint32_t changeflags = CHANGE_ISAPPEND;

assert(mailbox_index_islocked(mailbox, 1));
Expand Down Expand Up @@ -4730,9 +4730,10 @@ EXPORTED int mailbox_append_index_record(struct mailbox *mailbox,

if (!(record->internal_flags & FLAG_INTERNAL_UNLINKED)) {
/* make the file timestamp correct */
settime.actime = settime.modtime = record->internaldate;
if (!(object_storage_enabled && (record->internal_flags & FLAG_INTERNAL_ARCHIVED))) // mabe there is no file in directory.
if (utime(mailbox_record_fname(mailbox, record), &settime) == -1)
settime[0].tv_sec = settime[1].tv_sec = record->internaldate;
settime[0].tv_nsec = settime[1].tv_nsec = UTIME_NOW;
if (!(object_storage_enabled && (record->internal_flags & FLAG_INTERNAL_ARCHIVED))) // maybe there is no file in directory.
if (utimensat(0, mailbox_record_fname(mailbox, record), settime, 0) == -1)
return IMAP_IOERROR;

/* write the cache record before buffering the message, it
Expand Down

0 comments on commit f5d578d

Please sign in to comment.