From: Julien Danjou Date: Sat, 25 Nov 2006 17:10:50 +0000 (+0100) Subject: mutt_*mktemp-- X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=commitdiff_plain;h=916e4872caf252a5850e64f79427b9dd7808435d mutt_*mktemp-- Signed-off-by: Julien Danjou Signed-off-by: Pierre Habouzit --- diff --git a/attach.c b/attach.c index 4e6fff1..54bfc73 100644 --- a/attach.c +++ b/attach.c @@ -373,6 +373,7 @@ int mutt_view_attachment (FILE * fp, BODY * a, int flag, HEADER * hdr, rfc1524_entry *entry = NULL; int rc = -1; int unlink_tempfile = 0; + int pagerfd = -1; is_message = mutt_is_message_type (a->type, a->subtype); if (is_message && a->hdr && (a->hdr->security & ENCRYPT) && @@ -447,23 +448,21 @@ int mutt_view_attachment (FILE * fp, BODY * a, int flag, HEADER * hdr, if (fp && !use_mailcap && a->filename) { /* recv case */ m_strcpy(pagerfile, sizeof(pagerfile), a->filename); - mutt_adv_mktemp (NULL, pagerfile, sizeof (pagerfile)); + pagerfd = m_tempfd(pagerfile, sizeof(pagerfile), NONULL(Tempdir), pagerfile); } else { - mutt_mktemp (pagerfile); + pagerfd = m_tempfd(pagerfile, sizeof(pagerfile), NONULL(Tempdir), NULL); } } if (use_mailcap) { pid_t thepid = 0; - int tempfd = -1, pagerfd = -1; + int tempfd = -1; if (!use_pager) mutt_endwin (NULL); if (use_pager || use_pipe) { - if (use_pager - && ((pagerfd = safe_open (pagerfile, O_CREAT | O_EXCL | O_WRONLY)) - == -1)) { + if (use_pager && pagerfd == -1) { mutt_perror ("open"); goto return_error; }