X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=write.c;h=3b5f2d193f31ddc1d8c130703637810f807f255f;hp=fcb477f80a1d2bcaf94d0f4b1b220164fb8d67c5;hb=c0abcee0da53a6b399c3d16a62830aaa9ae21349;hpb=37dcd255ceb88c02cab500069956f4589c9d13e7 diff --git a/write.c b/write.c index fcb477f8..3b5f2d19 100644 --- a/write.c +++ b/write.c @@ -185,19 +185,16 @@ __noreturn static void print_help_and_die(void) * * \return Standard. */ -static int setup_writer_node(const char *arg, struct btr_node *parent, +static void setup_writer_node(const char *arg, struct btr_node *parent, struct writer_node *wn) { if (arg) - wn->conf = check_writer_arg(arg, &wn->writer_num); + wn->conf = check_writer_arg_or_die(arg, &wn->writer_num); else { wn->writer_num = DEFAULT_WRITER; wn->conf = writers[DEFAULT_WRITER].parse_config_or_die(""); } - if (!wn->conf) - return -E_WRITE_COMMON_SYNTAX; register_writer_node(wn, parent); - return 1; } static int setup_and_schedule(void) @@ -225,20 +222,14 @@ static int setup_and_schedule(void) register_task(&cwt->task); if (!conf.writer_given) { - i = 0; wns = para_calloc(sizeof(*wns)); - ret = setup_writer_node(NULL, cwt->btrn, wns); - if (ret < 0) - goto out; + setup_writer_node(NULL, cwt->btrn, wns); i = 1; } else { wns = para_calloc(conf.writer_given * sizeof(*wns)); - for (i = 0; i < conf.writer_given; i++) { - ret = setup_writer_node(conf.writer_arg[i], - cwt->btrn, wns + i); - if (ret < 0) - goto out; - } + for (i = 0; i < conf.writer_given; i++) + setup_writer_node(conf.writer_arg[i], cwt->btrn, + wns + i); } s.default_timeout.tv_sec = 10; @@ -258,7 +249,6 @@ static int setup_and_schedule(void) } } } -out: for (i--; i >= 0; i--) { struct writer_node *wn = wns + i; struct writer *w = writers + wn->writer_num;