X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=file_write.c;h=cea21cb3f5e182798f922b8234aa49977c85ba6b;hp=3f764766c39964a2f2736415a27cf56c4bad74ec;hb=573ed68b79ebbe62725672a9fae8eea00ac2e357;hpb=24758c5f17064273786e704b84ceff56c234e347 diff --git a/file_write.c b/file_write.c index 3f764766..cea21cb3 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,18 +118,18 @@ 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); - ret = write(pfwd->fd, buf, bytes); + ret = xwrite(pfwd->fd, buf, bytes); if (ret < 0) goto out; btr_consume(btrn, ret); 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)