]> rtime.felk.cvut.cz Git - frescor/frsh.git/blobdiff - fres/cbroker/fcb.c
forb: executable resources and fcb changed into dynamic libs
[frescor/frsh.git] / fres / cbroker / fcb.c
index 64180f0ab0557aa5a7d3c3192b259d52eb4352c2..f931d2eb4573fe4aa0eec574baf91772f455ed1d 100644 (file)
@@ -1469,7 +1469,6 @@ void peer_dead_callback(const forb_orb peer_orb, const char *orb_id)
 }
 
 static struct option long_opts[] = {
-    { "daemon",   optional_argument, NULL, 'd' },
     { "loglevel", required_argument, NULL, 'l' },
     { 0, 0, 0, 0}
 };
@@ -1478,7 +1477,6 @@ static void
 usage(void)
 {
        printf("usage: fcb [ options ]\n");
-       printf("  -d, --daemon [pid-file]   go to background after FORB initialization\n");
        printf("  -l, --loglevel <number>|<domain>=<number>,...\n");
 }
 
@@ -1488,9 +1486,8 @@ int print_log_domain(ul_log_domain_t *domain, void *context)
        return 0;
 }
 
-int main(int argc, char *argv[])
+int forb_main(forb_orb orb, int argc, char *argv[])
 {
-       forb_orb orb;
        struct fcb fcb_data;
        fres_contract_broker fcb;
        forb_executor_t executor;
@@ -1507,7 +1504,7 @@ int main(int argc, char *argv[])
        };
        int  opt;
 
-       while ((opt = getopt_long(argc, argv, "d::hl:", &long_opts[0], NULL)) != EOF) {
+       while ((opt = getopt_long(argc, argv, "hl:", &long_opts[0], NULL)) != EOF) {
                switch (opt) {
                        case 'l':
                                if (*optarg == '?') {
@@ -1521,10 +1518,6 @@ int main(int argc, char *argv[])
                                                error(1, EINVAL, "Error parsing -l argument at char %d\n", ret);
                                }
                                break;
-                       case 'd':
-                               opt_daemon = true;
-                               opt_pidfile = optarg;
-                               break;
                        case 'h':
                        /*default:*/
                                usage();
@@ -1538,9 +1531,6 @@ 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 initialization failed");
-
 #if CONFIG_FCB_INET && !CONFIG_FORB_PROTO_INET_DEFAULT
        ret = register_inet_port(orb);
        if (ret) error(0, errno, "INET port registration failed");