summaryrefslogtreecommitdiff
path: root/sysdep/unix
diff options
context:
space:
mode:
authorJan Maria Matejka <mq@ucw.cz>2018-08-28 16:45:50 +0200
committerJan Maria Matejka <mq@ucw.cz>2018-08-28 16:48:52 +0200
commit89b0af3978caf15e1478922a8d9d4f7e38145a61 (patch)
treeec8ac027a90abf435b1b602b332a5ee666b27607 /sysdep/unix
parenta043f2d79488cdfbc4d97ac0bad4926d29bf9a82 (diff)
Main: Add -b to force background even in debug mode
Diffstat (limited to 'sysdep/unix')
-rw-r--r--sysdep/unix/main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c
index ea1476e7..0912a9c5 100644
--- a/sysdep/unix/main.c
+++ b/sysdep/unix/main.c
@@ -624,7 +624,7 @@ signal_init(void)
* Parsing of command-line arguments
*/
-static char *opt_list = "c:dD:ps:P:u:g:flRh";
+static char *opt_list = "bc:dD:ps:P:u:g:flRh";
static int parse_and_exit;
char *bird_name;
static char *use_user;
@@ -645,6 +645,7 @@ display_help(void)
fprintf(stderr,
"\n"
"Options: \n"
+ " -b Run bird in background\n"
" -c <config-file> Use given configuration file instead\n"
" of prefix/etc/bird.conf\n"
" -d Enable debug messages and run bird in foreground\n"
@@ -749,16 +750,21 @@ 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;
+ 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;
@@ -857,7 +863,7 @@ main(int argc, char **argv)
if (parse_and_exit)
exit(0);
- if (!(debug_flag||run_in_foreground))
+ if (!run_in_foreground)
{
pid_t pid = fork();
if (pid < 0)