]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
stdin: Always set t->error correctly.
authorAndre Noll <maan@systemlinux.org>
Tue, 5 Jan 2010 22:05:58 +0000 (23:05 +0100)
committerAndre Noll <maan@systemlinux.org>
Tue, 5 Jan 2010 22:05:58 +0000 (23:05 +0100)
stdin.c

diff --git a/stdin.c b/stdin.c
index 8ef325b0fa9fea40ed18e40e96205a10851f6434..abe69cafd4270ddf0e82ed9d2b30d3cf3603f43a 100644 (file)
--- 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);
        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;
                goto err;
+       }
        btr_add_output(buf, ret, sit->btrn);
        return;
 err:
        btr_add_output(buf, ret, sit->btrn);
        return;
 err: