]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Flag -f "run in foreground" added as requested by a package maintainter.
authorOndrej Filip <feela@network.cz>
Sat, 5 Oct 2013 20:45:08 +0000 (22:45 +0200)
committerOndrej Filip <feela@network.cz>
Sat, 5 Oct 2013 20:45:08 +0000 (22:45 +0200)
doc/bird.sgml
sysdep/unix/main.c

index 050acf33a9786914eff371b8e1b9cab8dca74a6e..2b9ffa027b4d3f5169e5b5558c9576d321be5c32 100644 (file)
@@ -151,6 +151,9 @@ options. The most important ones are:
 
        <tag>-g <m/group/</tag>
        use that group ID, see the next section for details.
+
+       <tag>-f</tag>
+       run bird in foreground.
 </descrip>
 
 <p>BIRD writes messages about its work to log files or syslog (according to config).
index c7db7c8124b15db3477bb4b1ec03b77ad6ed52d6..165dab2b10467d55e31dd8c76c176b6e2992f364 100644 (file)
@@ -601,16 +601,17 @@ signal_init(void)
  *     Parsing of command-line arguments
  */
 
-static char *opt_list = "c:dD:ps:P:u:g:";
+static char *opt_list = "c:dD:ps:P:u:g:f";
 static int parse_and_exit;
 char *bird_name;
 static char *use_user;
 static char *use_group;
+static int run_in_foreground = 0;
 
 static void
 usage(void)
 {
-  fprintf(stderr, "Usage: %s [-c <config-file>] [-d] [-D <debug-file>] [-p] [-s <control-socket>] [-P <pid-file>] [-u <user>] [-g <group>]\n", bird_name);
+  fprintf(stderr, "Usage: %s [-c <config-file>] [-d] [-D <debug-file>] [-p] [-s <control-socket>] [-P <pid-file>] [-u <user>] [-g <group>] [-f]\n", bird_name);
   exit(1);
 }
 
@@ -718,6 +719,9 @@ parse_args(int argc, char **argv)
       case 'g':
        use_group = optarg;
        break;
+      case 'f':
+       run_in_foreground = 1;
+       break;
       default:
        usage();
       }
@@ -777,7 +781,7 @@ main(int argc, char **argv)
   if (parse_and_exit)
     exit(0);
 
-  if (!debug_flag)
+  if (!(debug_flag||run_in_foreground))
     {
       pid_t pid = fork();
       if (pid < 0)