1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

During initialization, log to both syslog and stderr. When a configuration

file has been read and it doesn't specify any logging, log to syslog only
(if syslog is not available, then stderr).
This commit is contained in:
Martin Mares
2000-06-09 07:32:57 +00:00
parent 0b3bf4b1d8
commit 5ddf4a58f9
3 changed files with 6 additions and 4 deletions

View File

@@ -184,7 +184,7 @@ debug(char *msg, ...)
}
void
log_init(int debug)
log_init(int debug, int init)
{
static struct log_config lc_stderr = { mask: ~0, terminal_flag: 1 };
@@ -197,6 +197,8 @@ log_init(int debug)
static struct log_config lc_syslog = { mask: ~0 };
openlog("bird", LOG_CONS | LOG_NDELAY, LOG_DAEMON);
add_tail(current_log_list, &lc_syslog.n);
if (!init)
return;
}
#endif
@@ -208,7 +210,7 @@ void
log_switch(list *l)
{
if (EMPTY_LIST(*l))
current_log_list = &init_log_list;
log_init(0, 0);
else
current_log_list = l;
}