summaryrefslogtreecommitdiff
path: root/mail/mutt/files/patch-mktemp
diff options
context:
space:
mode:
authorChris Rees <crees@FreeBSD.org>2012-07-22 09:15:04 +0000
committerChris Rees <crees@FreeBSD.org>2012-07-22 09:15:04 +0000
commitbb040dde3e08355fc3ff13644072333bff22f964 (patch)
tree48afad7ae2c1b5fd6c866fadb03127860561cb60 /mail/mutt/files/patch-mktemp
parent- Upgrade to 0.12.3.ja2. (diff)
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
Notes
Notes: svn path=/head/; revision=301308
Diffstat (limited to 'mail/mutt/files/patch-mktemp')
-rw-r--r--mail/mutt/files/patch-mktemp30
1 files changed, 19 insertions, 11 deletions
diff --git a/mail/mutt/files/patch-mktemp b/mail/mutt/files/patch-mktemp
index 8fc82de528d7..16521f758607 100644
--- a/mail/mutt/files/patch-mktemp
+++ b/mail/mutt/files/patch-mktemp
@@ -1,15 +1,23 @@
---- muttlib.c.orig Fri May 7 17:30:35 2004
-+++ muttlib.c Fri May 7 17:32:13 2004
-@@ -656,7 +656,11 @@
+--- 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)
+ void _mutt_mktemp (char *s, size_t slen, const char *src, int line)
{
-- snprintf (s, _POSIX_PATH_MAX, "%s/mutt-%s-%d-%d", NONULL (Tempdir), NONULL(Hostname), (int) getpid (), Counter++);
-+ char t[7];
-+ snprintf (t, 7, "-%05d", Counter++);
-+ snprintf (s, _POSIX_PATH_MAX-6, "%s/mutt-%s-XXXXXXXX", NONULL(Tempdir), NONULL(Hostname));
-+ mktemp (s);
-+ strncat(s, t, 6);
- unlink (s);
+- 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)