X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=write.c;h=fcb477f80a1d2bcaf94d0f4b1b220164fb8d67c5;hp=9762c40cd8e2b85dab8e0281eed1adc4c5acae86;hb=37dcd255ceb88c02cab500069956f4589c9d13e7;hpb=f2dfd6d47a71433c530773cfbf4039de8b065369 diff --git a/write.c b/write.c index 9762c40c..fcb477f8 100644 --- 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) @@ -223,7 +224,6 @@ static int main_btr(struct sched *s) cwt->task.error = 0; register_task(&cwt->task); - ret = -E_WRITE_SYNTAX; if (!conf.writer_given) { i = 0; wns = para_calloc(sizeof(*wns)); @@ -241,9 +241,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++) { @@ -286,8 +286,7 @@ out: */ int main(int argc, char *argv[]) { - int ret = -E_WRITE_SYNTAX; - static struct sched s; + int ret; writer_init(); write_cmdline_parser(argc, argv, &conf); @@ -295,7 +294,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);