summaryrefslogtreecommitdiff
path: root/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'log.c')
-rw-r--r--log.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/log.c b/log.c
index 07f866230..f7256d8e5 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;
@@ -134,11 +141,13 @@ error(const char *fmt,...)
134void 141void
135sigdie(const char *fmt,...) 142sigdie(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