From: Andre Noll Date: Mon, 25 Jul 2022 21:20:11 +0000 (+0200) Subject: i9e: Fix braino in i9e_post_select(). X-Git-Tag: v0.7.1~10^2~1 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=a707fa9f2906f932a7ae5ca516562fe6ff9f5bfa;p=paraslash.git i9e: Fix braino in i9e_post_select(). Due to this bug we mishandled the case where the read() returns zero to indicate EOF. In this case we stuffed a random character instead of shutting down the i9e task. --- diff --git a/interactive.c b/interactive.c index a8197308..4819e1c7 100644 --- a/interactive.c +++ b/interactive.c @@ -320,9 +320,10 @@ static int i9e_post_select(__a_unused struct sched *s, __a_unused void *context) ret = -ERRNO_TO_PARA_ERROR(errno); goto rm_btrn; } - ret = -E_I9E_EOF; - if (ret == 0) + if (ret == 0) { + ret = -E_I9E_EOF; goto rm_btrn; + } buf[1] = '\0'; i9ep->key_sequence_length++; rl_stuff_char((int)(unsigned char)*buf);