]> diplodocus.org Git - nmh/commitdiff
Fix post's die() to save errno before unlink(2)ing.
authorRalph Corderoy <ralph@inputplus.co.uk>
Mon, 17 Apr 2017 11:10:35 +0000 (12:10 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Mon, 17 Apr 2017 11:10:35 +0000 (12:10 +0100)
uip/post.c

index 7cc111e..c98f67e 100644 (file)
@@ -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);