summaryrefslogtreecommitdiff
path: root/sysdep
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2013-10-05 22:45:08 +0200
committerOndrej Filip <feela@network.cz>2013-10-05 22:45:08 +0200
commit1cd198cf52b3eae677159d81eacca3e0ebe24e71 (patch)
treee344e3eae13c5324c8cf3a9bb4b3d42c1f10122a /sysdep
parente7c2380260f20a4a3587b47df97879ef91c69774 (diff)
Flag -f "run in foreground" added as requested by a package maintainter.
Diffstat (limited to 'sysdep')
-rw-r--r--sysdep/unix/main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c
index c7db7c81..165dab2b 100644
--- a/sysdep/unix/main.c
+++ b/sysdep/unix/main.c
@@ -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)