summaryrefslogtreecommitdiff
path: root/bus/main.c
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2004-09-12 10:23:42 +0000
committerDavid Zeuthen <davidz@redhat.com>2004-09-12 10:23:42 +0000
commita24270a451c4ac7f8018bdd909a8f762e6abe80c (patch)
treeec7369b34b78779be8ee0bcb1b652b1571fd4275 /bus/main.c
parenta9ff341aa66588c12275529ee2d16843b493cb4f (diff)
downloaddbus-a24270a451c4ac7f8018bdd909a8f762e6abe80c.tar.gz
2004-09-12 David Zeuthen <david@fubar.dk>
Patch from Kay Sievers <kay.sievers@vrfy.org> * bus/bus.c (bus_context_new): * bus/bus.h: * bus/main.c (usage) (main): Add commandline option --nofork to override configuration file setting.
Diffstat (limited to 'bus/main.c')
-rw-r--r--bus/main.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/bus/main.c b/bus/main.c
index 01a6dd42..95727694 100644
--- a/bus/main.c
+++ b/bus/main.c
@@ -62,7 +62,7 @@ signal_handler (int sig)
static void
usage (void)
{
- fprintf (stderr, "dbus-daemon-1 [--version] [--session] [--system] [--config-file=FILE] [--print-address[=DESCRIPTOR]] [--print-pid[=DESCRIPTOR]] [--fork]\n");
+ fprintf (stderr, "dbus-daemon-1 [--version] [--session] [--system] [--config-file=FILE] [--print-address[=DESCRIPTOR]] [--print-pid[=DESCRIPTOR]] [--fork] [--nofork]\n");
exit (1);
}
@@ -200,8 +200,8 @@ main (int argc, char **argv)
int i;
dbus_bool_t print_address;
dbus_bool_t print_pid;
- dbus_bool_t force_fork;
-
+ int force_fork;
+
if (!_dbus_string_init (&config_file))
return 1;
@@ -210,25 +210,27 @@ main (int argc, char **argv)
if (!_dbus_string_init (&pid_fd))
return 1;
-
+
print_address = FALSE;
print_pid = FALSE;
- force_fork = FALSE;
-
+ force_fork = FORK_FOLLOW_CONFIG_FILE;
+
prev_arg = NULL;
i = 1;
while (i < argc)
{
const char *arg = argv[i];
-
+
if (strcmp (arg, "--help") == 0 ||
strcmp (arg, "-h") == 0 ||
strcmp (arg, "-?") == 0)
usage ();
else if (strcmp (arg, "--version") == 0)
version ();
+ else if (strcmp (arg, "--nofork") == 0)
+ force_fork = FORK_NEVER;
else if (strcmp (arg, "--fork") == 0)
- force_fork = TRUE;
+ force_fork = FORK_ALWAYS;
else if (strcmp (arg, "--system") == 0)
{
check_two_config_files (&config_file, "system");