X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=stdin.c;h=abe69cafd4270ddf0e82ed9d2b30d3cf3603f43a;hp=8ef325b0fa9fea40ed18e40e96205a10851f6434;hb=2b1f064a6357d027b4c06eee6cf191940726859e;hpb=5496ca9d07ede9aaa3afd86b60cdf16ed8ccca2b diff --git a/stdin.c b/stdin.c index 8ef325b0..abe69caf 100644 --- a/stdin.c +++ b/stdin.c @@ -113,12 +113,13 @@ static void stdin_post_select_btr(struct sched *s, struct task *t) buf = para_malloc(STDIN_INPUT_BUFFER_SIZE); ret = read(STDIN_FILENO, buf, STDIN_INPUT_BUFFER_SIZE); //PARA_CRIT_LOG("read ret: %d\n", ret); - if (ret < 0) - t->error = -ERRNO_TO_PARA_ERROR(errno); - if (ret == 0) - t->error = -E_STDIN_EOF; - if (t->error < 0) + if (ret <= 0) { + if (ret < 0) + ret = -ERRNO_TO_PARA_ERROR(errno); + else + ret = -E_STDIN_EOF; goto err; + } btr_add_output(buf, ret, sit->btrn); return; err: