From 36b78000a7bc14def417251aa50ebcdfcf182345 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sun, 20 May 2007 15:08:15 +1000 Subject: [PATCH] - djm@cvs.openbsd.org 2007/05/17 07:50:31 [log.c] save and restore errno when logging; ok deraadt@ --- ChangeLog | 5 ++++- log.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index df9443c72..c189c7810 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,9 @@ - dtucker@cvs.openbsd.org 2007/04/23 10:15:39 [servconf.c] Remove debug() left over from development. ok deraadt@ + - djm@cvs.openbsd.org 2007/05/17 07:50:31 + [log.c] + save and restore errno when logging; ok deraadt@ 20070509 - (tim) [configure.ac] Bug #1287: Add missing test for ucred.h. @@ -2912,4 +2915,4 @@ OpenServer 6 and add osr5bigcrypt support so when someone migrates passwords between UnixWare and OpenServer they will still work. OK dtucker@ -$Id: ChangeLog,v 1.4663 2007/05/20 05:03:15 dtucker Exp $ +$Id: ChangeLog,v 1.4664 2007/05/20 05:08:15 dtucker Exp $ diff --git a/log.c b/log.c index 7f8867482..fae5b043f 100644 --- a/log.c +++ b/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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -44,6 +44,7 @@ #include #include #include +#include #if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) # include #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; }