From a707fa9f2906f932a7ae5ca516562fe6ff9f5bfa Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 25 Jul 2022 23:20:11 +0200 Subject: [PATCH] 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. --- interactive.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); -- 2.39.2