diff options
author | Colin Watson <cjwatson@debian.org> | 2013-05-07 10:06:42 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2013-05-07 10:06:42 +0100 |
commit | ecebda56da46a03dafff923d91c382f31faa9eec (patch) | |
tree | 449614b6c06a2622c74a609b31fcc46c60037c56 /log.c | |
parent | c6a2c0334e45419875687d250aed9bea78480f2e (diff) | |
parent | ffc06452028ba78cd693d4ed43df8b60a10d6163 (diff) |
merge 6.2p1; reorder additions to monitor.h for easier merging in future
Diffstat (limited to 'log.c')
-rw-r--r-- | log.c | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: log.c,v 1.42 2011/06/17 21:44:30 djm Exp $ */ | 1 | /* $OpenBSD: log.c,v 1.43 2012/09/06 04:37:39 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 |
@@ -45,7 +45,7 @@ | |||
45 | #include <syslog.h> | 45 | #include <syslog.h> |
46 | #include <unistd.h> | 46 | #include <unistd.h> |
47 | #include <errno.h> | 47 | #include <errno.h> |
48 | #if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) | 48 | #if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) && !defined(BROKEN_STRNVIS) |
49 | # include <vis.h> | 49 | # include <vis.h> |
50 | #endif | 50 | #endif |
51 | 51 | ||
@@ -329,6 +329,21 @@ log_init(char *av0, LogLevel level, SyslogFacility facility, int on_stderr) | |||
329 | #endif | 329 | #endif |
330 | } | 330 | } |
331 | 331 | ||
332 | void | ||
333 | log_change_level(LogLevel new_log_level) | ||
334 | { | ||
335 | /* no-op if log_init has not been called */ | ||
336 | if (argv0 == NULL) | ||
337 | return; | ||
338 | log_init(argv0, new_log_level, log_facility, log_on_stderr); | ||
339 | } | ||
340 | |||
341 | int | ||
342 | log_is_on_stderr(void) | ||
343 | { | ||
344 | return log_on_stderr; | ||
345 | } | ||
346 | |||
332 | #define MSGBUFSIZ 1024 | 347 | #define MSGBUFSIZ 1024 |
333 | 348 | ||
334 | void | 349 | void |