From 6e379aa69edcac0c46b79aa888fb7650297f6944 Mon Sep 17 00:00:00 2001 From: Antonio Radici Date: Fri, 19 Jun 2009 19:39:05 +0100 Subject: [PATCH] new patch from upstream to fix the atime issue --- debian/patches/series | 3 +- .../{fix-3271.diff => 533439-mbox-time.patch} | 32 ++++++++----------- debian/stamp-patched | 0 3 files changed, 15 insertions(+), 20 deletions(-) rename debian/patches/upstream/{fix-3271.diff => 533439-mbox-time.patch} (81%) delete mode 100644 debian/stamp-patched diff --git a/debian/patches/series b/debian/patches/series index 3cb149e..29e2599 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -40,8 +40,7 @@ misc/smime.rc #upstream/502628-attach_charset-doc.patch #upstream/504530-stunnel-account_hook-doc.patch #upstream/530887-dovecot-imap.patch -upstream/fix-3271.diff - +upstream/533439-mbox-time.patch misc/hyphen-as-minus.patch #misc/manpage-typos.patch misc/smime_keys-manpage.patch diff --git a/debian/patches/upstream/fix-3271.diff b/debian/patches/upstream/533439-mbox-time.patch similarity index 81% rename from debian/patches/upstream/fix-3271.diff rename to debian/patches/upstream/533439-mbox-time.patch index b9dce5b..d7d51c6 100644 --- a/debian/patches/upstream/fix-3271.diff +++ b/debian/patches/upstream/533439-mbox-time.patch @@ -1,10 +1,9 @@ upstream test patch to fix the atime issue (See #533439 and upstream #3271) -diff --git a/mbox.c b/mbox.c --- a/mbox.c +++ b/mbox.c -@@ -681,22 +681,32 @@ int mbox_check_mailbox (CONTEXT *ctx, in +@@ -685,22 +685,30 @@ /* if mailbox has at least 1 new message, sets mtime > atime of mailbox * so buffy check reports new mail */ @@ -20,35 +19,32 @@ diff --git a/mbox.c b/mbox.c - for (i = 0; i < ctx->msgcount; i++) + if (!st) { +- if (!ctx->hdrs[i]->deleted && !ctx->hdrs[i]->read && !ctx->hdrs[i]->old) +- { +- utimebuf.actime = now - 1; +- utimebuf.modtime = now; +- utime (ctx->path, &utimebuf); + if (stat (ctx->path, &_st) < 0) -+ return; + return; +- } + st = &_st; -+ } + } + + utimebuf.actime = st->st_atime; + utimebuf.modtime = st->st_mtime; + + for (i = 0; !found && i < ctx->msgcount; i++) - if (!ctx->hdrs[i]->deleted && !ctx->hdrs[i]->read && !ctx->hdrs[i]->old) -- { -- utimebuf.actime = now - 1; -- utimebuf.modtime = now; -- utime (ctx->path, &utimebuf); -- return; -- } -- } ++ if (!ctx->hdrs[i]->deleted && !ctx->hdrs[i]->read && !ctx->hdrs[i]->old) + found = 1; + + if (found && utimebuf.actime >= utimebuf.modtime) + utimebuf.actime = utimebuf.modtime - 1; -+ else -+ utimebuf.actime = utimebuf.modtime; + + utime (ctx->path, &utimebuf); } /* return values: -@@ -712,6 +722,7 @@ int mbox_sync_mailbox (CONTEXT *ctx, int +@@ -716,6 +724,7 @@ int need_sort = 0; /* flag to resort mailbox if new mail arrives */ int first = -1; /* first message to be written */ LOFF_T offset; /* location in mailbox to write changed messages */ @@ -56,7 +52,7 @@ diff --git a/mbox.c b/mbox.c struct m_update_t *newOffset = NULL; struct m_update_t *oldOffset = NULL; FILE *fp = NULL; -@@ -903,6 +914,15 @@ int mbox_sync_mailbox (CONTEXT *ctx, int +@@ -907,6 +916,15 @@ } fp = NULL; @@ -72,7 +68,7 @@ diff --git a/mbox.c b/mbox.c if ((fp = fopen (tempfile, "r")) == NULL) { mutt_unblock_signals (); -@@ -972,6 +992,9 @@ int mbox_sync_mailbox (CONTEXT *ctx, int +@@ -976,6 +994,9 @@ return (-1); } @@ -82,7 +78,7 @@ diff --git a/mbox.c b/mbox.c /* reopen the mailbox in read-only mode */ if ((ctx->fp = fopen (ctx->path, "r")) == NULL) { -@@ -998,11 +1021,6 @@ int mbox_sync_mailbox (CONTEXT *ctx, int +@@ -1002,11 +1023,6 @@ unlink (tempfile); /* remove partial copy of the mailbox */ mutt_unblock_signals (); diff --git a/debian/stamp-patched b/debian/stamp-patched deleted file mode 100644 index e69de29..0000000 -- 2.43.0