]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
Merge branch 'master' of rtime.felk.cvut.cz:frescor/fwp master
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 27 Jan 2011 10:27:38 +0000 (11:27 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 27 Jan 2011 10:27:38 +0000 (11:27 +0100)
Conflicts:
fwp/mngr/fwp_mngr.c

fwp/mngr/fwp_mngr.c

index 1b66aacd5efd4176b7c39d5c302423423cdb554b..c94328ae063c82f4907b01f912e9794f2203335e 100644 (file)
@@ -124,13 +124,19 @@ int main(int argc, char *argv[])
        int ret;
        forb_init_attr_t attr = { .orb_id = "org.frescor.frm.fwp" };
        int  opt;
+       bool opt_daemon = false;
+       char *opt_pidfile = NULL;
 
        if (getenv("FWP_BYPASS"))
                priv.bypass = true;
 
 
-       while ((opt = getopt_long(argc, argv, "b:hl:os", &long_opts[0], NULL)) != EOF) {
+       while ((opt = getopt_long(argc, argv, "b:d:hl:os", &long_opts[0], NULL)) != EOF) {
                switch (opt) {
+                       case 'd':
+                               opt_daemon = true;
+                               opt_pidfile = optarg;
+                               break;
                        case 'l':
                                ul_log_domain_arg2levels(optarg);
                                break;
@@ -150,6 +156,9 @@ int main(int argc, char *argv[])
                }
        }
 
+       if (opt_daemon)
+               forb_daemon_prepare(opt_pidfile);
+
        orb = forb_init(&argc, &argv, &attr);
        if (!orb) error(1, errno, "forb_init");