file writer: Switch to the alternative post select method.
authorAndre Noll <maan@systemlinux.org>
Sun, 31 Mar 2013 13:59:41 +0000 (13:59 +0000)
committerAndre Noll <maan@systemlinux.org>
Tue, 30 Apr 2013 12:12:46 +0000 (14:12 +0200)
file_write.c

index 3f76476..41298a7 100644 (file)
@@ -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;