/*
- * Copyright (C) 1996-2002 Michael R. Elkins <me@mutt.org>
- * Copyright (C) 1999-2002 Thomas Roessler <roessler@does-not-exist.org>
+ * Copyright (C) 1996-2002,2007 Michael R. Elkins <me@mutt.org>
+ * Copyright (C) 1999-2005 Thomas Roessler <roessler@does-not-exist.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "mailbox.h"
#include "mx.h"
#include "copy.h"
-#include "buffy.h"
#include "sort.h"
-#include "account.h"
#if USE_HCACHE
#include "hcache.h"
#endif
/* XXX - we don't currently remove deleted messages from sequences we don't know. Should we? */
-void mh_update_sequences (CONTEXT * ctx)
+static void mh_update_sequences (CONTEXT * ctx)
{
FILE *ofp, *nfp;
/*
* This function does the second parsing pass
*/
-void maildir_delayed_parsing (CONTEXT * ctx, struct maildir **md,
+static void maildir_delayed_parsing (CONTEXT * ctx, struct maildir **md,
progress_t *progress)
{
struct maildir *p, *last = NULL;
return mh_mkstemp (dest, &msg->fp, &msg->path);
}
-int ch_compar (const void *a, const void *b)
+static int ch_compar (const void *a, const void *b)
{
return (int)( *((const char *) a) - *((const char *) b));
}
char full[_POSIX_PATH_MAX];
char *s;
- if (safe_fclose (&msg->fp) != 0)
+ if (safe_fsync_close (&msg->fp))
+ {
+ mutt_perror (_("Could not flush message to disk"));
return -1;
+ }
/* extract the subdir */
s = strrchr (msg->path, '/') + 1;
char path[_POSIX_PATH_MAX];
char tmp[16];
- if (safe_fclose (&msg->fp) != 0)
+ if (safe_fsync_close (&msg->fp))
+ {
+ mutt_perror (_("Could not flush message to disk"));
return -1;
+ }
if ((dirp = opendir (ctx->path)) == NULL)
{
/* create .mh_sequences when there isn't one. */
snprintf (buf, sizeof (buf), "%s/.mh_sequences", ctx->path);
- if ((i = stat (buf, &st_cur) == -1) && errno == ENOENT)
+ if ((i = stat (buf, &st_cur)) == -1 && errno == ENOENT)
{
char *tmp;
FILE *fp = NULL;
* then again, it's called rarely.
*/
-FILE *_maildir_open_find_message (const char *folder, const char *unique,
+static FILE *_maildir_open_find_message (const char *folder, const char *unique,
const char *subfolder)
{
char dir[_POSIX_PATH_MAX];