]> 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

1  2 
fwp/mngr/fwp_mngr.c

diff --combined fwp/mngr/fwp_mngr.c
index 1b66aacd5efd4176b7c39d5c302423423cdb554b,233215ddff03db9b9bae0f8962b36a021507935f..c94328ae063c82f4907b01f912e9794f2203335e
@@@ -115,7 -115,6 +115,7 @@@ usage(void
        printf("  -b, --bitrate <mbits/s>\n");
        printf("  -o, --ofdm\n");
        printf("  -s, --short-preamble\n");
 +      printf("  -h, --help\n");
  }
  
  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:l:hos", &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;
                }
        }
  
+       if (opt_daemon)
+               forb_daemon_prepare(opt_pidfile);
        orb = forb_init(&argc, &argv, &attr);
        if (!orb) error(1, errno, "forb_init");