~ubuntu-dev/ubuntu/lucid/mutt/lucid-201002110857

« back to all changes in this revision

Viewing changes to mh.c

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2009-06-07 17:30:03 UTC
  • mto: (16.2.1 experimental) (2.3.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: james.westby@ubuntu.com-20090607173003-rg37ui3h2bbv7wl0
Tags: upstream-1.5.19
ImportĀ upstreamĀ versionĀ 1.5.19

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 1996-2002 Michael R. Elkins <me@mutt.org>
3
 
 * Copyright (C) 1999-2002 Thomas Roessler <roessler@does-not-exist.org>
 
2
 * Copyright (C) 1996-2002,2007 Michael R. Elkins <me@mutt.org>
 
3
 * Copyright (C) 1999-2005 Thomas Roessler <roessler@does-not-exist.org>
4
4
 * 
5
5
 *     This program is free software; you can redistribute it and/or modify
6
6
 *     it under the terms of the GNU General Public License as published by
30
30
#include "mailbox.h"
31
31
#include "mx.h"
32
32
#include "copy.h"
33
 
#include "buffy.h"
34
33
#include "sort.h"
35
 
#include "account.h"
36
34
#if USE_HCACHE
37
35
#include "hcache.h"
38
36
#endif
312
310
 
313
311
/* XXX - we don't currently remove deleted messages from sequences we don't know.  Should we? */
314
312
 
315
 
void mh_update_sequences (CONTEXT * ctx)
 
313
static void mh_update_sequences (CONTEXT * ctx)
316
314
{
317
315
  FILE *ofp, *nfp;
318
316
 
978
976
/* 
979
977
 * This function does the second parsing pass
980
978
 */
981
 
void maildir_delayed_parsing (CONTEXT * ctx, struct maildir **md,
 
979
static void maildir_delayed_parsing (CONTEXT * ctx, struct maildir **md,
982
980
                              progress_t *progress)
983
981
984
982
  struct maildir *p, *last = NULL;
1175
1173
  return mh_mkstemp (dest, &msg->fp, &msg->path);
1176
1174
}
1177
1175
 
1178
 
int ch_compar (const void *a, const void *b)
 
1176
static int ch_compar (const void *a, const void *b)
1179
1177
{
1180
1178
  return (int)( *((const char *) a) - *((const char *) b));
1181
1179
}
1311
1309
  char full[_POSIX_PATH_MAX];
1312
1310
  char *s;
1313
1311
 
1314
 
  if (safe_fclose (&msg->fp) != 0)
 
1312
  if (safe_fsync_close (&msg->fp))
 
1313
  {
 
1314
    mutt_perror (_("Could not flush message to disk"));
1315
1315
    return -1;
 
1316
  }
1316
1317
 
1317
1318
  /* extract the subdir */
1318
1319
  s = strrchr (msg->path, '/') + 1;
1386
1387
  char path[_POSIX_PATH_MAX];
1387
1388
  char tmp[16];
1388
1389
 
1389
 
  if (safe_fclose (&msg->fp) != 0)
 
1390
  if (safe_fsync_close (&msg->fp))
 
1391
  {
 
1392
    mutt_perror (_("Could not flush message to disk"));
1390
1393
    return -1;
 
1394
  }
1391
1395
 
1392
1396
  if ((dirp = opendir (ctx->path)) == NULL)
1393
1397
  {
1976
1980
  
1977
1981
  /* create .mh_sequences when there isn't one. */
1978
1982
  snprintf (buf, sizeof (buf), "%s/.mh_sequences", ctx->path);
1979
 
  if ((i = stat (buf, &st_cur) == -1) && errno == ENOENT)
 
1983
  if ((i = stat (buf, &st_cur)) == -1 && errno == ENOENT)
1980
1984
  {
1981
1985
    char *tmp;
1982
1986
    FILE *fp = NULL;
2061
2065
 * then again, it's called rarely.
2062
2066
 */
2063
2067
 
2064
 
FILE *_maildir_open_find_message (const char *folder, const char *unique,
 
2068
static FILE *_maildir_open_find_message (const char *folder, const char *unique,
2065
2069
                                  const char *subfolder)
2066
2070
{
2067
2071
  char dir[_POSIX_PATH_MAX];