diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2007-05-17 07:50:32 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2007-05-17 07:50:32 +0000 |
commit | 7035a1767bee0ef9cc524953d0c706ab416d1048 (patch) | |
tree | 6cec5e8e92e6cd05674743ddf1bdae496fcb8985 /usr.bin/ssh | |
parent | 7970d50848b90219b630fc9c8df4e3f5c6afe392 (diff) |
save and restore errno when logging; ok deraadt@
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r-- | usr.bin/ssh/log.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/ssh/log.c b/usr.bin/ssh/log.c index 653875ddc25..6874ef697fe 100644 --- a/usr.bin/ssh/log.c +++ b/usr.bin/ssh/log.c @@ -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 @@ -42,6 +42,7 @@ #include <string.h> #include <syslog.h> #include <unistd.h> +#include <errno.h> #include <vis.h> #include "xmalloc.h" @@ -277,6 +278,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; @@ -330,4 +332,5 @@ do_log(LogLevel level, const char *fmt, va_list args) syslog_r(pri, &sdata, "%.500s", fmtbuf); closelog_r(&sdata); } + errno = saved_errno; } |