From 2ef92c3ac1de4ad63c0d99d50621d825f639d58f Mon Sep 17 00:00:00 2001 From: schwarze Date: Tue, 10 Aug 2021 14:28:10 +0000 Subject: [PATCH] While el_gets(3) and el_wgets(3) wait for user input, no longer ignore the first signal received. No change for SIGCONT and SIGWINCH, but for other signals, return to the application program and let that program decide what to do, typically either exit or provide a fresh prompt. Bug originally reported by deraadt@ regarding behaviour of Ctrl-C in sftp(1). With this patch, sftp(1) no longer ignores Ctrl-C but exists, and the same applies to a few other programs. Some others that used to ignore Ctrl-C now provide a fresh prompt instead. For several, behaviour is unchanged. At this point, i'm not aware of a serious regression in any program. OK deraadt@ martijn@ and no objection from millert@. Patch also tested by claudio@ with bgplgsh(8). --- lib/libedit/read.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/libedit/read.c b/lib/libedit/read.c index 63dd846c196..754d898a222 100644 --- a/lib/libedit/read.c +++ b/lib/libedit/read.c @@ -1,4 +1,4 @@ -/* $OpenBSD: read.c,v 1.45 2021/08/09 09:11:26 schwarze Exp $ */ +/* $OpenBSD: read.c,v 1.46 2021/08/10 14:28:10 schwarze Exp $ */ /* $NetBSD: read.c,v 1.100 2016/05/24 19:31:27 christos Exp $ */ /*- @@ -146,9 +146,6 @@ read__fixio(int fd, int e) return -1; return 0; - case EINTR: - return 0; - default: return -1; } -- 2.20.1