diff options
author | Brendan Cully <brendan@kublai.com> | 2007-03-31 18:50:39 -0700 |
---|---|---|
committer | Brendan Cully <brendan@kublai.com> | 2007-03-31 18:50:39 -0700 |
commit | 83189399b8b0f3117c42748f4518438ba4bb628c (patch) | |
tree | 167f7e50608727bdaa468397aeef764122db9cc3 /imap/message.c | |
parent | c6406c3da6d7944dbb709111cdac8ef4c2d2fa35 (diff) |
Add tmp flag to bcache_put, create bcache_commit.
Diffstat (limited to 'imap/message.c')
-rw-r--r-- | imap/message.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/imap/message.c b/imap/message.c index a25c1738..3f3b2347 100644 --- a/imap/message.c +++ b/imap/message.c @@ -903,23 +903,21 @@ static FILE* msg_cache_put (IMAP_DATA* idata, HEADER* h) return NULL; idata->bcache = msg_cache_open (idata); - snprintf (id, sizeof (id), "%u-%u.tmp", idata->uid_validity, HEADER_DATA(h)->uid); - return mutt_bcache_put (idata->bcache, id); + snprintf (id, sizeof (id), "%u-%u", idata->uid_validity, HEADER_DATA(h)->uid); + return mutt_bcache_put (idata->bcache, id, 1); } static int msg_cache_commit (IMAP_DATA* idata, HEADER* h) { char id[_POSIX_PATH_MAX]; - char newid[_POSIX_PATH_MAX]; if (!idata || !h) return -1; idata->bcache = msg_cache_open (idata); - snprintf (id, sizeof (id), "%u-%u.tmp", idata->uid_validity, HEADER_DATA(h)->uid); - snprintf (newid, sizeof (newid), "%u-%u", idata->uid_validity, HEADER_DATA(h)->uid); + snprintf (id, sizeof (id), "%u-%u", idata->uid_validity, HEADER_DATA(h)->uid); - return mutt_bcache_move (idata->bcache, id, newid); + return mutt_bcache_commit (idata->bcache, id); } int imap_cache_del (IMAP_DATA* idata, HEADER* h) |