summaryrefslogtreecommitdiff
path: root/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'log.c')
-rw-r--r--log.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/log.c b/log.c
index 96ab24b04..7f8867482 100644
--- a/log.c
+++ b/log.c
@@ -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"
37RCSID("$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
47static LogLevel log_level = SYSLOG_LEVEL_INFO; 54static LogLevel log_level = SYSLOG_LEVEL_INFO;
48static int log_on_stderr = 1; 55static int log_on_stderr = 1;
49static int log_facility = LOG_AUTH; 56static int log_facility = LOG_AUTH;
@@ -130,6 +137,20 @@ error(const char *fmt,...)
130 va_end(args); 137 va_end(args);
131} 138}
132 139
140void
141sigdie(const char *fmt,...)
142{
143#ifdef DO_LOG_SAFE_IN_SIGHAND
144 va_list args;
145
146 va_start(args, fmt);
147 do_log(SYSLOG_LEVEL_FATAL, fmt, args);
148 va_end(args);
149#endif
150 _exit(1);
151}
152
153
133/* Log this message (information that usually should go to the log). */ 154/* Log this message (information that usually should go to the log). */
134 155
135void 156void