mbox-file.c revision e5afebd2df1d4990f7bec2a839260ff2e6d78168
/* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "istream.h"
#include "mbox-storage.h"
#include "mbox-sync-private.h"
#include "mbox-file.h"
#include "istream-raw-mbox.h"
#include <utime.h>
{
int fd;
/* read-only mbox stream */
return 0;
}
}
if (fd == -1) {
return -1;
}
return -1;
}
return 0;
}
{
i_error("close(mbox) failed: %m");
}
}
{
return 0;
/* read-only mbox stream */
mbox->mbox_stream =
return 0;
}
if (mbox_file_open(mbox) < 0)
return -1;
}
if (mbox->mbox_writeonly)
else {
}
return 0;
}
{
/* we've seen recent messages which we want to keep recent.
keep file's atime lower than mtime so \Marked status
gets shown while listing */
return;
}
return;
}
}
}
}
{
/* if we read anything, fix the atime if needed */
/* read-only mbox stream */
} else {
}
}
}
struct mail_index_view *view,
{
const void *data;
bool deleted;
if (deleted)
return -1;
"Cached message offset lost for seq %u in mbox file %s",
return 0;
}
return 1;
}
{
int ret;
if (ret <= 0) {
return ret;
}
if (offset == 0) {
"Mailbox isn't a valid mbox file");
return -1;
}
if (mbox->mbox_sync_dirty)
return 0;
"Cached message offset %s is invalid for mbox file %s",
return 0;
}
if (mbox->mbox_sync_dirty) {
/* we're dirty - make sure this is the correct mail */
return 0;
}
return 1;
}