{
int i, ret = 1;
- PARA_NOTICE_LOG("opening wng with %d writer(s)\n", g->num_writers);
+ PARA_NOTICE_LOG("opening wng %p with %d writer(s)\n", g, g->num_writers);
FOR_EACH_WRITER_NODE(i, g) {
struct writer_node *wn = &g->writer_nodes[i];
+ wn->wng = g;
ret = wn->writer->open(wn);
if (ret < 0)
goto out;
wn->chunk_bytes = ret;
g->max_chunk_bytes = PARA_MAX(g->max_chunk_bytes, ret);
- wn->wng = g;
PARA_DEBUG_LOG("pre_select: %p\n", &wn->writer->pre_select);
PARA_DEBUG_LOG("post_select: %p\n", &wn->writer->post_select);
wn->task.pre_select = wn->writer->pre_select;
{
int i;
+ if (!g)
+ return;
PARA_NOTICE_LOG("closing wng with %d writer(s)\n", g->num_writers);
FOR_EACH_WRITER_NODE(i, g) {
struct writer_node *wn = &g->writer_nodes[i];