]> andersk Git - openssh.git/blobdiff - log.c
- (tim) [regress/sftp-cmds.sh] s/cd/lcd/ in lls test. Reported by
[openssh.git] / log.c
diff --git a/log.c b/log.c
index 0ce4d85f7c2772804862a55543d6afc9e144f5c4..fae5b043f3e55701a9ca1d8a99aa9791e2513bff 100644 (file)
--- 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 <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
@@ -140,9 +141,9 @@ error(const char *fmt,...)
 void
 sigdie(const char *fmt,...)
 {
+#ifdef DO_LOG_SAFE_IN_SIGHAND
        va_list args;
 
-#ifdef DO_LOG_SAFE_IN_SIGHAND
        va_start(args, fmt);
        do_log(SYSLOG_LEVEL_FATAL, fmt, args);
        va_end(args);
@@ -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;
 }
This page took 0.055438 seconds and 4 git commands to generate.