]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
During initialization, log to both syslog and stderr. When a configuration
authorMartin Mares <mj@ucw.cz>
Fri, 9 Jun 2000 07:32:57 +0000 (07:32 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 9 Jun 2000 07:32:57 +0000 (07:32 +0000)
file has been read and it doesn't specify any logging, log to syslog only
(if syslog is not available, then stderr).

sysdep/unix/log.c
sysdep/unix/main.c
sysdep/unix/unix.h

index b13c9415f84dc6886f1c9d5c77de7b2eba4f8157..cc15ff3ea3f612792c018338919499b899a6424a 100644 (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;
 }
index fed833bb4bfcc1e3229956118e6ac82131f6314d..e0e3ca98b468d3b4e90980289a507a44a2d45f2d 100644 (file)
@@ -408,7 +408,7 @@ main(int argc, char **argv)
   parse_args(argc, argv);
   if (debug_flag == 1)
     log_init_debug("");
-  log_init(debug_flag);
+  log_init(debug_flag, 1);
 
   DBG("Initializing.\n");
   resource_init();
index 68850bcc68eac371a51c34fb54c6f95446472a00..5da925c49896586d93cd7ae9b60863d72c809b0f 100644 (file)
@@ -49,7 +49,7 @@ void krt_io_init(void);
 
 /* log.c */
 
-void log_init(int debug);
+void log_init(int debug, int init);
 void log_init_debug(char *);           /* Initialize debug dump to given file (NULL=stderr, ""=off) */
 void log_switch(struct list *);