Currently the file writer's ->post_select() sets t->error to -1 on
errors, rather than using a proper error code. This may result in
a segfault when this number is passed to para_strerror().
Replacing the call to write() by xwrite() not only gives a proper
error code but also treats EAGAIN as a non-fatal error.
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);