diff options
Diffstat (limited to 'log.c')
-rw-r--r-- | log.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: log.c,v 1.39 2006/08/18 09:13:25 deraadt Exp $ */ | 1 | /* $OpenBSD: log.c,v 1.40 2007/05/17 07:50:31 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -44,6 +44,7 @@ | |||
44 | #include <string.h> | 44 | #include <string.h> |
45 | #include <syslog.h> | 45 | #include <syslog.h> |
46 | #include <unistd.h> | 46 | #include <unistd.h> |
47 | #include <errno.h> | ||
47 | #if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) | 48 | #if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) |
48 | # include <vis.h> | 49 | # include <vis.h> |
49 | #endif | 50 | #endif |
@@ -315,6 +316,7 @@ do_log(LogLevel level, const char *fmt, va_list args) | |||
315 | char fmtbuf[MSGBUFSIZ]; | 316 | char fmtbuf[MSGBUFSIZ]; |
316 | char *txt = NULL; | 317 | char *txt = NULL; |
317 | int pri = LOG_INFO; | 318 | int pri = LOG_INFO; |
319 | int saved_errno = errno; | ||
318 | 320 | ||
319 | if (level > log_level) | 321 | if (level > log_level) |
320 | return; | 322 | return; |
@@ -375,4 +377,5 @@ do_log(LogLevel level, const char *fmt, va_list args) | |||
375 | closelog(); | 377 | closelog(); |
376 | #endif | 378 | #endif |
377 | } | 379 | } |
380 | errno = saved_errno; | ||
378 | } | 381 | } |