From 1fc7f8b3dfeaed655392eb0b30f841d54494a2a1 Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Mon, 17 Apr 2017 12:10:35 +0100 Subject: [PATCH] Fix post's die() to save errno before unlink(2)ing. --- uip/post.c | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 2.56.0