summaryrefslogtreecommitdiff
path: root/sysdep/unix/main.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2018-12-04 16:55:25 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2018-12-04 16:55:25 +0100
commit3fda08e40532245ba69e14cdac0623a138b939f9 (patch)
tree0332e47c73ab22c92df09518de90fefa89453b2a /sysdep/unix/main.c
parent0642fb4d456fe12e1bbeb2ffc2149433f228c02e (diff)
Unix: Change debugging options
The old behavior was that enabling debugging did many nontrivial changes in BIRD behavior. The patch changes it that these changes are generally independent. Compiling with --enable-debug now just enables compile-time debug macros, but do not automatically activate debug mode (-d) nor local mode (-l). Debug mode with output to file (-D) do not force foreground mode (-f), therefore there is no need for backgroud option (-b), which is removed. Also fixes a bug when the default log target in -D mode was stderr instead of given debug file.
Diffstat (limited to 'sysdep/unix/main.c')
-rw-r--r--sysdep/unix/main.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c
index d2380501..c31ccd17 100644
--- a/sysdep/unix/main.c
+++ b/sysdep/unix/main.c
@@ -44,12 +44,6 @@
* Debugging
*/
-#ifdef DEBUGGING
-static int debug_flag = 1;
-#else
-static int debug_flag = 0;
-#endif
-
void
async_dump(void)
{
@@ -185,7 +179,7 @@ sysdep_preconfig(struct config *c)
int
sysdep_commit(struct config *new, struct config *old UNUSED)
{
- log_switch(debug_flag, &new->logfiles, new->syslog_name);
+ log_switch(0, &new->logfiles, new->syslog_name);
return 0;
}
@@ -750,21 +744,16 @@ parse_args(int argc, char **argv)
while ((c = getopt(argc, argv, opt_list)) >= 0)
switch (c)
{
- case 'b':
- run_in_foreground = 0;
- break;
case 'c':
config_name = optarg;
config_changed = 1;
break;
case 'd':
- debug_flag |= 1;
+ log_init_debug("");
run_in_foreground = 1;
break;
case 'D':
log_init_debug(optarg);
- debug_flag |= 2;
- run_in_foreground = 1;
break;
case 'p':
parse_and_exit = 1;
@@ -822,9 +811,7 @@ main(int argc, char **argv)
#endif
parse_args(argc, argv);
- if (debug_flag == 1)
- log_init_debug("");
- log_switch(debug_flag, NULL, NULL);
+ log_switch(1, NULL, NULL);
net_init();
resource_init();