]> git.ipfire.org Git - people/ms/dma.git/commitdiff
errlog: preserve errno
authorSimon Schubert <2@0x2c.org>
Sun, 12 Dec 2010 23:51:19 +0000 (00:51 +0100)
committerSimon Schubert <2@0x2c.org>
Sun, 12 Dec 2010 23:51:19 +0000 (00:51 +0100)
util.c

diff --git a/util.c b/util.c
index 2f95b72a65909278f7cd62932b951982d3833161..b32919d14e762fe94e2dccac3b83ef04e5c20594 100644 (file)
--- a/util.c
+++ b/util.c
@@ -145,6 +145,7 @@ errlog(int exitcode, const char *fmt, ...)
                va_end(ap);
        }
 
+       errno = oerrno;
        if (*outs != 0) {
                syslog(LOG_ERR, "%s: %m", outs);
                fprintf(stderr, "%s: %s: %s\n", getprogname(), outs, strerror(oerrno));