From: Richard Russon Date: Thu, 19 Jul 2018 09:40:55 +0000 (+0100) Subject: sort out mkstemp error messages X-Git-Tag: 2019-10-25~749^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7202add315bcabc16d7c6353c79e1970ae5913b3;p=neomutt sort out mkstemp error messages --- diff --git a/imap/message.c b/imap/message.c index 41898e21a..730a275a1 100644 --- a/imap/message.c +++ b/imap/message.c @@ -654,7 +654,7 @@ int imap_read_headers(struct ImapData *idata, unsigned int msn_begin, unsigned i FILE *fp = mutt_file_mkstemp(); if (!fp) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); goto error_out_0; } diff --git a/mutt/history.c b/mutt/history.c index 49a89328e..04728be70 100644 --- a/mutt/history.c +++ b/mutt/history.c @@ -258,7 +258,7 @@ static void shrink_histfile(void) tmpfp = mutt_file_mkstemp(); if (!tmpfp) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); goto cleanup; } rewind(f); diff --git a/ncrypt/crypt_gpgme.c b/ncrypt/crypt_gpgme.c index d46506fae..30794741f 100644 --- a/ncrypt/crypt_gpgme.c +++ b/ncrypt/crypt_gpgme.c @@ -1999,7 +1999,7 @@ int pgp_gpgme_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body decoded_fp = mutt_file_mkstemp(); if (!decoded_fp) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); return -1; } @@ -2019,7 +2019,7 @@ int pgp_gpgme_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body *fpout = mutt_file_mkstemp(); if (!*fpout) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); rc = -1; goto bail; } @@ -2072,7 +2072,7 @@ int smime_gpgme_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Bo FILE *tmpfp = mutt_file_mkstemp(); if (!tmpfp) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); return -1; } @@ -2089,7 +2089,7 @@ int smime_gpgme_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Bo *fpout = mutt_file_mkstemp(); if (!*fpout) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); return -1; } @@ -2124,7 +2124,7 @@ int smime_gpgme_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Bo FILE *tmpfp2 = mutt_file_mkstemp(); if (!tmpfp2) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); return -1; } @@ -2142,7 +2142,7 @@ int smime_gpgme_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Bo *fpout = mutt_file_mkstemp(); if (!*fpout) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); return -1; } @@ -2222,7 +2222,7 @@ static int pgp_gpgme_extract_keys(gpgme_data_t keydata, FILE **fp, int dryrun) *fp = mutt_file_mkstemp(); if (!*fp) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); goto err_tmpdir; } @@ -2742,7 +2742,7 @@ int pgp_gpgme_encrypted_handler(struct Body *a, struct State *s) FILE *fpout = mutt_file_mkstemp(); if (!fpout) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); if (s->flags & MUTT_DISPLAY) { state_attach_puts(_("[-- Error: could not create temporary file! " @@ -2818,7 +2818,7 @@ int smime_gpgme_application_handler(struct Body *a, struct State *s) FILE *fpout = mutt_file_mkstemp(); if (!fpout) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); if (s->flags & MUTT_DISPLAY) { state_attach_puts(_("[-- Error: could not create temporary file! " diff --git a/ncrypt/pgp.c b/ncrypt/pgp.c index 7613abf7e..375beeb97 100644 --- a/ncrypt/pgp.c +++ b/ncrypt/pgp.c @@ -536,7 +536,7 @@ int pgp_class_application_handler(struct Body *m, struct State *s) pgpout = mutt_file_mkstemp(); if (!pgpout) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); rc = -1; goto out; } @@ -544,7 +544,7 @@ int pgp_class_application_handler(struct Body *m, struct State *s) pgperr = mutt_file_mkstemp(); if (!pgperr) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); rc = -1; goto out; } @@ -840,7 +840,7 @@ int pgp_class_verify_one(struct Body *sigbdy, struct State *s, const char *tempf FILE *pgperr = mutt_file_mkstemp(); if (!pgperr) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); unlink(sigfile); return -1; } @@ -944,7 +944,7 @@ static struct Body *pgp_decrypt_part(struct Body *a, struct State *s, FILE *pgperr = mutt_file_mkstemp(); if (!pgperr) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); return NULL; } @@ -1086,7 +1086,7 @@ int pgp_class_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body decoded_fp = mutt_file_mkstemp(); if (!decoded_fp) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); return -1; } @@ -1106,7 +1106,7 @@ int pgp_class_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body *fpout = mutt_file_mkstemp(); if (!*fpout) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); rc = -1; goto bail; } @@ -1140,7 +1140,7 @@ int pgp_class_encrypted_handler(struct Body *a, struct State *s) FILE *fpout = mutt_file_mkstemp(); if (!fpout) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); if (s->flags & MUTT_DISPLAY) state_attach_puts(_("[-- Error: could not create temporary file! --]\n"), s); return -1; @@ -1470,7 +1470,7 @@ struct Body *pgp_class_encrypt_message(struct Body *a, char *keylist, bool sign) FILE *pgperr = mutt_file_mkstemp(); if (!pgperr) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); unlink(tempfile); mutt_file_fclose(&fpout); return NULL; @@ -1660,7 +1660,7 @@ struct Body *pgp_class_traditional_encryptsign(struct Body *a, int flags, char * FILE *pgperr = mutt_file_mkstemp(); if (!pgpout || !pgperr) { - mutt_perror(pgpout ? "mutt_file_mkstemp() failed!" : pgpoutfile); + mutt_perror(pgpout ? "Can't create temporary file" : pgpoutfile); unlink(pgpinfile); if (pgpout) { diff --git a/ncrypt/pgpmicalg.c b/ncrypt/pgpmicalg.c index 282449798..57d5abd79 100644 --- a/ncrypt/pgpmicalg.c +++ b/ncrypt/pgpmicalg.c @@ -161,7 +161,7 @@ static short pgp_find_hash(const char *fname) FILE *out = mutt_file_mkstemp(); if (!out) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); goto bye; } diff --git a/ncrypt/smime.c b/ncrypt/smime.c index 12668a700..7f50fde21 100644 --- a/ncrypt/smime.c +++ b/ncrypt/smime.c @@ -1020,7 +1020,7 @@ static int smime_handle_cert_email(char *certificate, char *mailbox, int copy, FILE *fperr = mutt_file_mkstemp(); if (!fperr) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); return 1; } @@ -1028,7 +1028,7 @@ static int smime_handle_cert_email(char *certificate, char *mailbox, int copy, if (!fpout) { mutt_file_fclose(&fperr); - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); return 1; } @@ -1108,7 +1108,7 @@ static char *smime_extract_certificate(char *infile) FILE *fperr = mutt_file_mkstemp(); if (!fperr) { - mutt_perror("mutt_file_mkstemp() failed"); + mutt_perror(_("Can't create temporary file")); return NULL; } @@ -1210,7 +1210,7 @@ static char *smime_extract_signer_certificate(char *infile) FILE *fperr = mutt_file_mkstemp(); if (!fperr) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); return NULL; } @@ -1271,7 +1271,7 @@ void smime_class_invoke_import(char *infile, char *mailbox) FILE *fperr = mutt_file_mkstemp(); if (!fperr) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); return; } @@ -1279,7 +1279,7 @@ void smime_class_invoke_import(char *infile, char *mailbox) if (!fpout) { mutt_file_fclose(&fperr); - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); return; } @@ -1440,7 +1440,7 @@ struct Body *smime_class_build_smime_entity(struct Body *a, char *certlist) FILE *smimeerr = mutt_file_mkstemp(); if (!smimeerr) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); mutt_file_unlink(tempfile); mutt_file_fclose(&fpout); return NULL; @@ -1784,7 +1784,7 @@ int smime_class_verify_one(struct Body *sigbdy, struct State *s, const char *tem FILE *smimeerr = mutt_file_mkstemp(); if (!smimeerr) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); mutt_file_unlink(signedfile); return -1; } @@ -1860,14 +1860,14 @@ static struct Body *smime_handle_entity(struct Body *m, struct State *s, FILE *o FILE *smimeout = mutt_file_mkstemp(); if (!smimeout) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); return NULL; } FILE *smimeerr = mutt_file_mkstemp(); if (!smimeerr) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); mutt_file_fclose(&smimeout); return NULL; } @@ -1969,7 +1969,7 @@ static struct Body *smime_handle_entity(struct Body *m, struct State *s, FILE *o fpout = mutt_file_mkstemp(); if (!fpout) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); mutt_file_fclose(&smimeout); mutt_file_fclose(&smimeerr); return NULL; @@ -2069,7 +2069,7 @@ int smime_class_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Bo FILE *tmpfp = mutt_file_mkstemp(); if (!tmpfp) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); return -1; } @@ -2085,7 +2085,7 @@ int smime_class_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Bo *fpout = mutt_file_mkstemp(); if (!*fpout) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); rc = -1; goto bail; } diff --git a/nntp/nntp.c b/nntp/nntp.c index f8e744d92..a9425c081 100644 --- a/nntp/nntp.c +++ b/nntp/nntp.c @@ -1417,7 +1417,7 @@ static int nntp_fetch_headers(struct Context *ctx, void *hc, anum_t first, FILE *fp = mutt_file_mkstemp(); if (!fp) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); rc = -1; break; } @@ -2452,7 +2452,7 @@ int nntp_check_msgid(struct Context *ctx, const char *msgid) FILE *fp = mutt_file_mkstemp(); if (!fp) { - mutt_perror("mutt_file_mkstemp() failed!"); + mutt_perror(_("Can't create temporary file")); return -1; } diff --git a/pattern.c b/pattern.c index 8dff75d42..a9c044a3f 100644 --- a/pattern.c +++ b/pattern.c @@ -998,7 +998,7 @@ static int msg_search(struct Context *ctx, struct Pattern *pat, int msgno) s.fpout = mutt_file_mkstemp(); if (!s.fpout) { - mutt_perror("mutt_file_mkstemp() failed"); + mutt_perror(_("Can't create temporary file")); return 0; } #endif diff --git a/pop/pop.c b/pop/pop.c index 25d435aeb..ad9d4822d 100644 --- a/pop/pop.c +++ b/pop/pop.c @@ -127,7 +127,7 @@ static int pop_read_header(struct PopData *pop_data, struct Header *h) FILE *f = mutt_file_mkstemp(); if (!f) { - mutt_perror("mutt_file_mkstemp failed!"); + mutt_perror(_("Can't create temporary file")); return -3; }