diff options
author | Darren Tucker <dtucker@zip.com.au> | 2007-05-20 07:08:15 +0200 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2007-05-20 07:08:15 +0200 |
commit | 36b78000a7bc14def417251aa50ebcdfcf182345 (patch) | |
tree | d567174fe3a08e7e59383ca337bb9fd422c5592b /log.c | |
parent | - dtucker@cvs.openbsd.org 2007/04/23 10:15:39 (diff) | |
download | openssh-36b78000a7bc14def417251aa50ebcdfcf182345.tar.xz openssh-36b78000a7bc14def417251aa50ebcdfcf182345.zip |
- djm@cvs.openbsd.org 2007/05/17 07:50:31
[log.c]
save and restore errno when logging; ok deraadt@
Diffstat (limited to 'log.c')
-rw-r--r-- | log.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.39 2006/08/18 09:13:25 deraadt Exp $ */ +/* $OpenBSD: log.c,v 1.40 2007/05/17 07:50:31 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -44,6 +44,7 @@ #include <string.h> #include <syslog.h> #include <unistd.h> +#include <errno.h> #if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) # include <vis.h> #endif @@ -313,6 +314,7 @@ do_log(LogLevel level, const char *fmt, va_list args) char fmtbuf[MSGBUFSIZ]; char *txt = NULL; int pri = LOG_INFO; + int saved_errno = errno; if (level > log_level) return; @@ -373,4 +375,5 @@ do_log(LogLevel level, const char *fmt, va_list args) closelog(); #endif } + errno = saved_errno; } |