]> err.no Git - systemd/commitdiff
make sure the log functions don't modify errno
authorLennart Poettering <lennart@poettering.net>
Wed, 27 Jan 2010 21:39:29 +0000 (22:39 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 27 Jan 2010 21:39:29 +0000 (22:39 +0100)
log.c

diff --git a/log.c b/log.c
index 8d292139343da0925e422850a75681abc6d4d17c..ec3cab5b905e66e70a1f9b08c9901ac9eb5b2f82 100644 (file)
--- a/log.c
+++ b/log.c
@@ -6,6 +6,7 @@
 
 #include <stdarg.h>
 #include <stdio.h>
+#include <errno.h>
 
 #include "log.h"
 
@@ -18,6 +19,7 @@ void log_meta(
 
         const char *prefix, *suffix;
         va_list ap;
+        int saved_errno = errno;
 
         if (LOG_PRI(level) <= LOG_ERR) {
                 prefix = "\x1B[1;31m";
@@ -35,4 +37,5 @@ void log_meta(
 
         va_end(ap);
 
+        errno = saved_errno;
 }