summaryrefslogtreecommitdiff
path: root/sys/src/cmd/upas/fs/imap.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2017-04-09 04:32:38 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2017-04-09 04:32:38 +0200
commit1d94a18e5683d0d69aca4c8350b7914419fae6bc (patch)
treeb376bbefc5cd770d1bc15f0683f2441137f4d5c0 /sys/src/cmd/upas/fs/imap.c
parent35f6a75355ea4f52f675f9cfbb865241512a7315 (diff)
upas/fs: fix sync condition
we used to check for mb->d->name != nil before stating, to avoid stating pop3/imap mailboxes who don't really have a local file, but this breaks when the md->d is reconstructed (faked) from the index! resulting in the mailbox stop being refreshed. the solution is to not have mb->d == nil for imap/pop mailoxes.
Diffstat (limited to 'sys/src/cmd/upas/fs/imap.c')
-rw-r--r--sys/src/cmd/upas/fs/imap.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/src/cmd/upas/fs/imap.c b/sys/src/cmd/upas/fs/imap.c
index bc8313474..460994949 100644
--- a/sys/src/cmd/upas/fs/imap.c
+++ b/sys/src/cmd/upas/fs/imap.c
@@ -39,7 +39,7 @@ typedef struct {
typedef struct Imap Imap;
struct Imap {
- long lastread;
+ ulong lastread;
char *mbox;
/* free this to free the strings below */
@@ -913,7 +913,7 @@ imap4read(Imap *imap, Mailbox *mb, int doplumb, int *new)
Message *m, **ll;
*new = 0;
- if(time(0) - imap->lastread < 10)
+ if((ulong)time(0) - imap->lastread < 10)
return nil;
imap->lastread = time(0);
imap4cmd(imap, "status %Z (messages uidvalidity)", imap->mbox);
@@ -1008,10 +1008,9 @@ imap4sync(Mailbox *mb, int doplumb, int *new)
imap = mb->aux;
if(err = imap4dial(imap))
goto out;
- if((err = imap4read(imap, mb, doplumb, new)) == nil)
- mb->d->atime = mb->d->mtime = time(0);
+ err = imap4read(imap, mb, doplumb, new);
out:
- mb->waketime = time(0) + imap->refreshtime;
+ mb->waketime = (ulong)time(0) + imap->refreshtime;
return err;
}
@@ -1185,7 +1184,6 @@ imap4mbox(Mailbox *mb, char *path)
mb->rename = imap4rename;
// mb->remove = imap4remove;
mb->modflags = imap4modflags;
- mb->d = emalloc(sizeof *mb->d);
mb->addfrom = 1;
return nil;
}