ports/mail/mutt/files/patch-mktemp
Chris Rees bb040dde3e Move mail/mutt to mail/mutt14
Move mail/mutt-lite to mail/mutt14-lite

Move mail/mutt-devel to mail/mutt

Moving mail/mutt-devel-lite to mail/mutt-lite will follow next to avoid
breaking the cvs exporter

PR:		ports/169546
Suggested by:	obrien
Approved by:	maintainer
2012-07-22 09:15:04 +00:00

23 lines
1.1 KiB
Text

--- muttlib.c.orig 2010-09-19 09:58:24.000000000 +0200
+++ muttlib.c 2010-09-19 10:36:26.000000000 +0200
@@ -788,14 +788,15 @@
void _mutt_mktemp (char *s, size_t slen, const char *src, int line)
{
- size_t n = snprintf (s, slen, "%s/mutt-%s-%d-%d-%ld%ld", NONULL (Tempdir), NONULL (Hostname),
- (int) getuid (), (int) getpid (), random (), random ());
+ size_t n = snprintf (s, slen, "%s/mutt-%s-XXXXXXXX", NONULL (Tempdir), NONULL (Hostname));
if (n >= slen)
dprint (1, (debugfile, "%s:%d: ERROR: insufficient buffer space to hold temporary filename! slen=%zu but need %zu\n",
src, line, slen, n));
- dprint (3, (debugfile, "%s:%d: mutt_mktemp returns \"%s\".\n", src, line, s));
- if (unlink (s) && errno != ENOENT)
- dprint (1, (debugfile, "%s:%d: ERROR: unlink(\"%s\"): %s (errno %d)\n", src, line, s, strerror (errno), errno));
+ if (mktemp (s)) {
+ dprint (3, (debugfile, "%s:%d: mutt_mktemp returns \"%s\".\n", src, line, s));
+ } else {
+ dprint (1, (debugfile, "%s:%d: ERROR: mktemp(\"%s\"): %s (errno %d)\n", src, line, s, strerror (errno), errno));
+ }
}
void mutt_free_alias (ALIAS **p)