From 83af8d49dbabe03ba56084a32e7a45a4b5b39370 Mon Sep 17 00:00:00 2001 From: Michael Elkins Date: Tue, 24 Aug 2010 09:38:14 -0700 Subject: [PATCH] do not print debug message on ENOENT --- muttlib.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/muttlib.c b/muttlib.c index bc3275dc1..2160ceb46 100644 --- a/muttlib.c +++ b/muttlib.c @@ -781,14 +781,14 @@ void mutt_merge_envelopes(ENVELOPE* base, ENVELOPE** extra) 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-%d-%d-%ld%ld", NONULL (Tempdir), NONULL (Hostname), + (int) getuid (), (int) getpid (), random (), random ()); 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 (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)) - dprint(1, (debugfile, "%s:%d: ERROR: unable to unlink temporary file\n", src, line)); + if (unlink (s) && errno != ENOENT) + dprint (1, (debugfile, "%s:%d: ERROR: unlink(\"%s\"): %s (errno %d)\n", src, line, s, strerror (errno), errno)); } void mutt_free_alias (ALIAS **p) -- 2.49.0