X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;ds=inline;f=file_write.c;h=4a4dc66e52d61b2a5e632bbadd67f26a5f42ed27;hb=bb991c66000ea867d0fcbd692ffdc5473eb785fb;hp=0cee535aa92ff9b5aaba1b815c8e8c95e0dd4731;hpb=e5f02e0748de02eabfb8e0746af09eb676ec1dc0;p=paraslash.git diff --git a/file_write.c b/file_write.c index 0cee535a..4a4dc66e 100644 --- a/file_write.c +++ b/file_write.c @@ -129,17 +129,13 @@ out: t->error = ret; } -__malloc static void *file_write_parse_config(const char *options) +__malloc static void *file_write_parse_config_or_die(const char *options) { - struct file_write_args_info *conf - = para_calloc(sizeof(struct file_write_args_info)); - int ret = file_cmdline_parser_string(options, conf, "file_write"); - - PARA_INFO_LOG("conf->filename_given: %d\n", conf->filename_given); - if (!ret) - return conf; - free(conf); - return NULL; + struct file_write_args_info *conf = para_calloc(sizeof(*conf)); + + /* exits on errors */ + file_cmdline_parser_string(options, conf, "file_write"); + return conf; } static void file_write_free_config(void *conf) @@ -156,7 +152,7 @@ void file_write_init(struct writer *w) w->open = file_write_open; w->pre_select = file_write_pre_select; w->post_select = file_write_post_select; - w->parse_config = file_write_parse_config; + w->parse_config_or_die = file_write_parse_config_or_die; w->free_config = file_write_free_config; w->close = file_write_close; w->shutdown = NULL; /* nothing to do */