From: Andre Noll Date: Sun, 31 Mar 2013 13:59:41 +0000 (+0000) Subject: file writer: Switch to the alternative post select method. X-Git-Tag: v0.4.13~39^2~24 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=c29db36ca7dc00846dc2cdb2c04efba5ec52021d;p=paraslash.git file writer: Switch to the alternative post select method. --- diff --git a/file_write.c b/file_write.c index 3f764766..41298a74 100644 --- a/file_write.c +++ b/file_write.c @@ -97,7 +97,7 @@ static void file_write_close(struct writer_node *wn) free(pfwd); } -static void file_write_post_select(__a_unused struct sched *s, +static int file_write_post_select(__a_unused struct sched *s, struct task *t) { struct writer_node *wn = container_of(t, struct writer_node, task); @@ -118,7 +118,7 @@ static void file_write_post_select(__a_unused struct sched *s, goto out; } if (!FD_ISSET(pfwd->fd, &s->wfds)) - return; + return 0; bytes = btr_next_buffer(btrn, &buf); assert(bytes > 0); //PARA_INFO_LOG("writing %zu\n", bytes); @@ -129,7 +129,7 @@ static void file_write_post_select(__a_unused struct sched *s, out: if (ret < 0) btr_remove_node(&wn->btrn); - t->error = ret; + return ret; } __malloc static void *file_write_parse_config_or_die(int argc, char **argv) @@ -153,7 +153,8 @@ void file_write_init(struct writer *w) file_write_cmdline_parser_init(&dummy); w->pre_select = file_write_pre_select; - w->post_select = file_write_post_select; + w->new_post_select = file_write_post_select; + w->post_select = NULL; w->parse_config_or_die = file_write_parse_config_or_die; w->free_config = file_write_free_config; w->close = file_write_close;