sot->check_fd = 0;
if (sz == 0) {
if (btr_no_parent(sot->btrn)) {
- t->error = -E_ORPHAN;
- btr_del_node(sot->btrn);
s->timeout.tv_sec = 0;
s->timeout.tv_usec = 1;
}
struct stdout_task *sot = container_of(t, struct stdout_task, task);
ssize_t ret;
size_t sz = btr_get_input_queue_size(sot->btrn);
- bool orphan = btr_no_parent(sot->btrn);
char *buf;
t->error = 0;
if (!sot->check_fd) {
- if (sz == 0 && orphan) {
+ if (sz == 0 && btr_no_parent(sot->btrn)) {
t->error = -E_ORPHAN;
goto err;
}
sz = btr_next_buffer(sot->btrn, &buf);
if (sz == 0)
return;
- ret = write(STDOUT_FILENO, buf, sz);
+ ret = write_nonblock(STDOUT_FILENO, buf, sz, 0);
if (ret < 0) {
t->error = -ERRNO_TO_PARA_ERROR(errno);
goto err;