]> git.tue.mpg.de Git - paraslash.git/commitdiff
write: Rename main_btr() to setup_and_schedule().
authorAndre Noll <maan@systemlinux.org>
Sat, 6 Aug 2011 20:01:48 +0000 (22:01 +0200)
committerAndre Noll <maan@systemlinux.org>
Sat, 13 Aug 2011 11:00:32 +0000 (13:00 +0200)
The old name was a leftover from the long ago when para_write
started to use the buffer tree API.

write.c

diff --git a/write.c b/write.c
index 9762c40cd8e2b85dab8e0281eed1adc4c5acae86..3d1b093264bf3e88602b4dc146929582c5b896ed 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);