X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=stdout.c;h=d167cd1460225ad964c343b6129aedcac7c73c65;hp=6539b68f3ff8f91befc8d99cf6b5c3002b2b9e98;hb=764e787bc065694b2e9b05159a92104d585f59eb;hpb=0b101563e67c91bc660f6a16b5889901d9e8eeff diff --git a/stdout.c b/stdout.c index 6539b68f..d167cd14 100644 --- a/stdout.c +++ b/stdout.c @@ -54,8 +54,6 @@ static void stdout_pre_select_btr(struct sched *s, struct task *t) 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; } @@ -104,12 +102,11 @@ static void stdout_post_select_btr(struct sched *s, struct task *t) 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; } @@ -120,7 +117,7 @@ static void stdout_post_select_btr(struct sched *s, struct task *t) 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;