diff options
Diffstat (limited to 'log.c')
-rw-r--r-- | log.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: log.c,v 1.46 2015/07/08 19:04:21 markus Exp $ */ | 1 | /* $OpenBSD: log.c,v 1.48 2016/07/15 05:01:58 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -176,6 +176,16 @@ sigdie(const char *fmt,...) | |||
176 | _exit(1); | 176 | _exit(1); |
177 | } | 177 | } |
178 | 178 | ||
179 | void | ||
180 | logdie(const char *fmt,...) | ||
181 | { | ||
182 | va_list args; | ||
183 | |||
184 | va_start(args, fmt); | ||
185 | do_log(SYSLOG_LEVEL_INFO, fmt, args); | ||
186 | va_end(args); | ||
187 | cleanup_exit(255); | ||
188 | } | ||
179 | 189 | ||
180 | /* Log this message (information that usually should go to the log). */ | 190 | /* Log this message (information that usually should go to the log). */ |
181 | 191 | ||
@@ -342,7 +352,7 @@ log_change_level(LogLevel new_log_level) | |||
342 | int | 352 | int |
343 | log_is_on_stderr(void) | 353 | log_is_on_stderr(void) |
344 | { | 354 | { |
345 | return log_on_stderr; | 355 | return log_on_stderr && log_stderr_fd == STDERR_FILENO; |
346 | } | 356 | } |
347 | 357 | ||
348 | /* redirect what would usually get written to stderr to specified file */ | 358 | /* redirect what would usually get written to stderr to specified file */ |