From: Ralph Corderoy Date: Mon, 17 Apr 2017 11:10:35 +0000 (+0100) Subject: Fix post's die() to save errno before unlink(2)ing. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/1fc7f8b3dfeaed655392eb0b30f841d54494a2a1 Fix post's die() to save errno before unlink(2)ing. --- diff --git a/uip/post.c b/uip/post.c index 7cc111e4..c98f67ed 100644 --- a/uip/post.c +++ b/uip/post.c @@ -2006,8 +2006,11 @@ fcc (char *file, char *folder) static void die (char *what, char *fmt, ...) { + int err; va_list ap; + err = errno; + (void) m_unlink (tmpfil); if (msgflags & MINV) (void) m_unlink (bccfil); @@ -2016,6 +2019,7 @@ die (char *what, char *fmt, ...) sm_end (NOTOK); va_start(ap, fmt); + errno = err; advertise (what, NULL, fmt, ap); va_end(ap); done (1);