]> rtime.felk.cvut.cz Git - frescor/frsh.git/blobdiff - resources/cpucg/mngr/frm_cgcpu.c
forb: added scripts executing dynamic shared libraries
[frescor/frsh.git] / resources / cpucg / mngr / frm_cgcpu.c
index f9c288b0e67fa5d0105573c0e6347957962e5610..a48ec0be7be7ef4e7c192cfead44810cf3218a0d 100644 (file)
@@ -127,24 +127,18 @@ usage(void)
        printf("  -l, --loglevel <number>|<domain>=<number>,...\n");
 }
 
-int main(int argc, char *argv[])
+int forb_main(forb_orb orb, int argc, char *argv[])
 {
-       forb_orb orb;
        FILE* fd;
        int ret;
        int  opt;
-       forb_init_attr_t attr = { .orb_id = "org.frescor.frm.cgcpu" };
        bool opt_daemon = false;
        char *opt_pidfile = NULL;
 
        ul_logreg_domain(&ulogd_frm_cpucg);
 
-       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 'd':
-                               opt_daemon = true;
-                               opt_pidfile = optarg;
-                               break;
                        case 'l':
                                ul_log_domain_arg2levels(optarg);
                                break;
@@ -155,11 +149,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_init");
        
        if (!(fd = fopen("/proc/sys/kernel/sched_rt_period_us", "r"))) {
                error(1, errno, "frm_generic_run");