summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-01-27 22:39:29 +0100
committerLennart Poettering <lennart@poettering.net>2010-01-27 22:39:29 +0100
commitc9b97d2a838899d00004fbfbd3f8c2e6932c89a0 (patch)
tree129ca3f7a68435e6bf33084f7c03cd22395a2b90
parentc25fb0edbb8a1d4fc2e466a355e7d3e5ddeacd5e (diff)
make sure the log functions don't modify errno
-rw-r--r--log.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/log.c b/log.c
index 8d29213934..ec3cab5b90 100644
--- 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;
}