diff options
Diffstat (limited to 'log.c')
-rw-r--r-- | log.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -1,3 +1,4 @@ | |||
1 | /* $OpenBSD: log.c,v 1.39 2006/08/18 09:13:25 deraadt Exp $ */ | ||
1 | /* | 2 | /* |
2 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
3 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -34,16 +35,22 @@ | |||
34 | */ | 35 | */ |
35 | 36 | ||
36 | #include "includes.h" | 37 | #include "includes.h" |
37 | RCSID("$OpenBSD: log.c,v 1.29 2003/09/23 20:17:11 markus Exp $"); | ||
38 | 38 | ||
39 | #include "log.h" | 39 | #include <sys/types.h> |
40 | #include "xmalloc.h" | ||
41 | 40 | ||
41 | #include <stdarg.h> | ||
42 | #include <stdio.h> | ||
43 | #include <stdlib.h> | ||
44 | #include <string.h> | ||
42 | #include <syslog.h> | 45 | #include <syslog.h> |
46 | #include <unistd.h> | ||
43 | #if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) | 47 | #if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) |
44 | # include <vis.h> | 48 | # include <vis.h> |
45 | #endif | 49 | #endif |
46 | 50 | ||
51 | #include "xmalloc.h" | ||
52 | #include "log.h" | ||
53 | |||
47 | static LogLevel log_level = SYSLOG_LEVEL_INFO; | 54 | static LogLevel log_level = SYSLOG_LEVEL_INFO; |
48 | static int log_on_stderr = 1; | 55 | static int log_on_stderr = 1; |
49 | static int log_facility = LOG_AUTH; | 56 | static int log_facility = LOG_AUTH; |
@@ -134,11 +141,13 @@ error(const char *fmt,...) | |||
134 | void | 141 | void |
135 | sigdie(const char *fmt,...) | 142 | sigdie(const char *fmt,...) |
136 | { | 143 | { |
144 | #ifdef DO_LOG_SAFE_IN_SIGHAND | ||
137 | va_list args; | 145 | va_list args; |
138 | 146 | ||
139 | va_start(args, fmt); | 147 | va_start(args, fmt); |
140 | do_log(SYSLOG_LEVEL_FATAL, fmt, args); | 148 | do_log(SYSLOG_LEVEL_FATAL, fmt, args); |
141 | va_end(args); | 149 | va_end(args); |
150 | #endif | ||
142 | _exit(1); | 151 | _exit(1); |
143 | } | 152 | } |
144 | 153 | ||