X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=mh.c;h=04d0c83d4ec5d2c97463d7f2b06ba264f78ac597;hp=3a29cce56f3ea0a4ee0751b62f6decdf4ea565d0;hb=71fd9a28c9d86aefdc689910cbd06dcc285fa278;hpb=ce2c6b74b93777c66708ef0cfb7cc14ff1bf6a94 diff --git a/mh.c b/mh.c index 3a29cce..04d0c83 100644 --- a/mh.c +++ b/mh.c @@ -22,6 +22,10 @@ * mailboxes. */ +#if HAVE_CONFIG_H +# include "config.h" +#endif + #include "mutt.h" #include "mailbox.h" #include "mx.h" @@ -192,7 +196,8 @@ static int mh_mkstemp (CONTEXT * dest, FILE ** fp, char **tgt) { snprintf (path, _POSIX_PATH_MAX, "%s/.mutt-%s-%d-%d", dest->path, NONULL (Hostname), (int) getpid (), Counter++); - if ((fd = open (path, O_WRONLY | O_EXCL | O_CREAT, 0600)) == -1) + umask(Umask); + if ((fd = open (path, O_WRONLY | O_EXCL | O_CREAT, 0666)) == -1) { if (errno != EEXIST) { @@ -910,6 +915,8 @@ void maildir_delayed_parsing (CONTEXT * ctx, struct maildir *md) when = (struct timeval *) data; #endif + if (!ctx->quiet && ReadInc && ((count % ReadInc) == 0 || count == 1)) + mutt_message (_("Reading %s... %d"), ctx->path, count); snprintf (fn, sizeof (fn), "%s/%s", ctx->path, p->h->path); #if USE_HCACHE @@ -1073,14 +1080,15 @@ int maildir_open_new_message (MESSAGE * msg, CONTEXT * dest, HEADER * hdr) FOREVER { - snprintf (path, _POSIX_PATH_MAX, "%s/tmp/%s.%ld.%d_%d.%s%s", - dest->path, subdir, time (NULL), getpid (), Counter++, - NONULL (Hostname), suffix); + snprintf (path, _POSIX_PATH_MAX, "%s/tmp/%s.%ld.%u_%d.%s%s", + dest->path, subdir, time (NULL), (unsigned int)getpid (), + Counter++, NONULL (Hostname), suffix); dprint (2, (debugfile, "maildir_open_new_message (): Trying %s.\n", path)); - if ((fd = open (path, O_WRONLY | O_EXCL | O_CREAT, 0600)) == -1) + umask(Umask); + if ((fd = open (path, O_WRONLY | O_EXCL | O_CREAT, 0666)) == -1) { if (errno != EEXIST) { @@ -1154,8 +1162,9 @@ int maildir_commit_message (CONTEXT * ctx, MESSAGE * msg, HEADER * hdr) /* construct a new file name. */ FOREVER { - snprintf (path, _POSIX_PATH_MAX, "%s/%ld.%d_%d.%s%s", subdir, - time (NULL), getpid (), Counter++, NONULL (Hostname), suffix); + snprintf (path, _POSIX_PATH_MAX, "%s/%ld.%u_%d.%s%s", subdir, + time (NULL), (unsigned int)getpid (), Counter++, + NONULL (Hostname), suffix); snprintf (full, _POSIX_PATH_MAX, "%s/%s", ctx->path, path); dprint (2, (debugfile, "maildir_commit_message (): renaming %s to %s.\n",