X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;ds=sidebyside;f=stdin.c;h=079865f7ac982bbcdf8103a5418e58a0d05e25b2;hb=71b24ff5561efe1ae93176f8d2ef707d94b6b222;hp=d080e2165b169ec3fd03bf0c669ac6ec05188985;hpb=aa05cb41dd2f031935507e89b56b1e6096b846db;p=paraslash.git diff --git a/stdin.c b/stdin.c index d080e216..079865f7 100644 --- a/stdin.c +++ b/stdin.c @@ -46,18 +46,12 @@ static void stdin_pre_select(struct sched *s, struct task *t) para_fd_set(STDIN_FILENO, &s->rfds, &s->max_fileno); } -#define STDIN_MAX_PENDING (1024 * 1024) +#define STDIN_MAX_PENDING (100 * 1024) static void stdin_pre_select_btr(struct sched *s, struct task *t) { struct stdin_task *sit = container_of(t, struct stdin_task, task); - if (btr_no_children(sit->btrn)) { - t->error = -E_STDIN_NO_CHILD; - btr_del_node(sit->btrn); - sit->btrn = NULL; - return; - } t->error = 0; if (btr_bytes_pending(sit->btrn) > STDIN_MAX_PENDING) sit->check_fd = 0; @@ -101,7 +95,7 @@ static void stdin_post_select(struct sched *s, struct task *t) t->error = -E_STDIN_EOF; } -#define STDIN_INPUT_BUFFER_SIZE 4000 +#define STDIN_INPUT_BUFFER_SIZE (1024 * 32) static void stdin_post_select_btr(struct sched *s, struct task *t) { struct stdin_task *sit = container_of(t, struct stdin_task, task); @@ -120,6 +114,7 @@ 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) @@ -130,8 +125,7 @@ static void stdin_post_select_btr(struct sched *s, struct task *t) return; err: free(buf); - btr_del_node(sit->btrn); - sit->btrn = NULL; + btr_remove_node(sit->btrn); } /**