- ret = write(STDOUT_FILENO, *sot->bufp, *sot->loaded);
- if (ret < 0) {
- t->error = -ERRNO_TO_PARA_ERROR(errno);
- return;
+
+ for (;;) {
+ sz = btr_next_buffer(btrn, &buf);
+ if (sz == 0)
+ break;
+ ret = write_nonblock(STDOUT_FILENO, buf, sz, 0);
+ if (ret <= 0)
+ break;
+ btr_consume(btrn, ret);