write: Rename main_btr() to setup_and_schedule().
[paraslash.git] / write.c
diff --git a/write.c b/write.c
index 9762c40..3d1b093 100644 (file)
--- a/write.c
+++ b/write.c
@@ -200,11 +200,12 @@ static int setup_writer_node(const char *arg, struct btr_node *parent,
        return 1;
 }
 
-static int main_btr(struct sched *s)
+static int setup_and_schedule(void)
 {
        int i, ret;
        struct check_wav_task _cwt, *cwt = &_cwt;
        struct writer_node *wns;
+       static struct sched s;
 
        loglevel = get_loglevel_by_name(conf.loglevel_arg);
        sit.btrn = btr_new_node(&(struct btr_node_description)
@@ -241,9 +242,9 @@ static int main_btr(struct sched *s)
                }
        }
 
-       s->default_timeout.tv_sec = 10;
-       s->default_timeout.tv_usec = 50000;
-       ret = schedule(s);
+       s.default_timeout.tv_sec = 10;
+       s.default_timeout.tv_usec = 50000;
+       ret = schedule(&s);
        if (ret >= 0) {
                int j;
                for (j = 0; j < i; j++) {
@@ -287,7 +288,6 @@ out:
 int main(int argc, char *argv[])
 {
        int ret = -E_WRITE_SYNTAX;
-       static struct sched s;
 
        writer_init();
        write_cmdline_parser(argc, argv, &conf);
@@ -295,7 +295,7 @@ int main(int argc, char *argv[])
        if (conf.help_given || conf.detailed_help_given)
                print_help_and_die();
 
-       ret = main_btr(&s);
+       ret = setup_and_schedule();
        if (ret < 0) {
                PARA_ERROR_LOG("%s\n", para_strerror(-ret));
                exit(EXIT_FAILURE);