summaryrefslogtreecommitdiff
path: root/lib/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/log.c')
-rw-r--r--lib/log.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/log.c b/lib/log.c
index 453a611dcd..ea50ae18cc 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -179,6 +179,7 @@ static void
vzlog (struct zlog *zl, int priority, const char *format, va_list args)
{
char proto_str[32];
+ int original_errno = errno;
struct timestamp_control tsctl;
tsctl.already_rendered = 0;
@@ -197,6 +198,7 @@ vzlog (struct zlog *zl, int priority, const char *format, va_list args)
fflush (stderr);
/* In this case we return at here. */
+ errno = original_errno;
return;
}
tsctl.precision = zl->timestamp_precision;
@@ -249,6 +251,8 @@ vzlog (struct zlog *zl, int priority, const char *format, va_list args)
if (priority <= zl->maxlvl[ZLOG_DEST_MONITOR])
vty_log ((zl->record_priority ? zlog_priority[priority] : NULL),
proto_str, format, &tsctl, args);
+
+ errno = original_errno;
}
static char *