From: Andre Noll Date: Tue, 1 Apr 2008 20:05:46 +0000 (+0200) Subject: wng_open(): Defer registering the wng task. X-Git-Tag: v0.3.2~33 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=0afd787fee5d6990c6a0fa91767ab1c4322f8908;hp=68e0489ae1fe946162d9cedb7767513f2d4ea8d2 wng_open(): Defer registering the wng task. This way we do not have to unregister it on errors. --- diff --git a/write_common.c b/write_common.c index f9560d7f..037bb728 100644 --- a/write_common.c +++ b/write_common.c @@ -79,7 +79,6 @@ int wng_open(struct writer_node_group *g) int i, ret = 1; PARA_NOTICE_LOG("opening wng %p with %d writer(s)\n", g, g->num_writers); - register_task(&g->task); FOR_EACH_WRITER_NODE(i, g) { struct writer_node *wn = &g->writer_nodes[i]; wn->wng = g; @@ -90,10 +89,10 @@ int wng_open(struct writer_node_group *g) g->max_chunk_bytes = PARA_MAX(g->max_chunk_bytes, ret); } sprintf(g->task.status, "%s", "writer node group"); + register_task(&g->task); return 1; err_out: PARA_ERROR_LOG("%s\n", para_strerror(-ret)); - unregister_task(&g->task); while (i > 0) { struct writer_node *wn = &g->writer_nodes[--i]; wn->writer->close(wn);