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 |
@@ -313,6 +314,7 @@ do_log(LogLevel level, const char *fmt, va_list args) | |||
313 | char fmtbuf[MSGBUFSIZ]; | 314 | char fmtbuf[MSGBUFSIZ]; |
314 | char *txt = NULL; | 315 | char *txt = NULL; |
315 | int pri = LOG_INFO; | 316 | int pri = LOG_INFO; |
317 | int saved_errno = errno; | ||
316 | 318 | ||
317 | if (level > log_level) | 319 | if (level > log_level) |
318 | return; | 320 | return; |
@@ -373,4 +375,5 @@ do_log(LogLevel level, const char *fmt, va_list args) | |||
373 | closelog(); | 375 | closelog(); |
374 | #endif | 376 | #endif |
375 | } | 377 | } |
378 | errno = saved_errno; | ||
376 | } | 379 | } |