Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2022-01-17 05:02:40 +0300
committerDenys Vlasenko <vda.linux@googlemail.com>2022-01-17 13:46:23 +0300
commit12566e7f9b5e5c5d445bc4d36991d134b431dc6c (patch)
tree2571356a77f7d421da368e9b31dad182e83b2408 /miscutils
parenta277506a64404e6c4472ff89c944c4f353db1c33 (diff)
ash,hush: fix handling of SIGINT while waiting for interactive input
function old new delta lineedit_read_key 160 237 +77 __pgetc 522 589 +67 fgetc_interactive 244 309 +65 safe_read_key - 39 +39 read_key 588 607 +19 record_pending_signo 23 32 +9 signal_handler 75 81 +6 .rodata 104312 104309 -3 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 6/1 up/down: 282/-3) Total: 279 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/hexedit.c2
-rw-r--r--miscutils/less.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/miscutils/hexedit.c b/miscutils/hexedit.c
index f8ff9b62b..15ad78377 100644
--- a/miscutils/hexedit.c
+++ b/miscutils/hexedit.c
@@ -292,7 +292,7 @@ int hexedit_main(int argc UNUSED_PARAM, char **argv)
fflush_all();
G.in_read_key = 1;
if (!bb_got_signal)
- key = read_key(STDIN_FILENO, G.read_key_buffer, -1);
+ key = safe_read_key(STDIN_FILENO, G.read_key_buffer, -1);
G.in_read_key = 0;
if (bb_got_signal)
key = CTRL('X');
diff --git a/miscutils/less.c b/miscutils/less.c
index 82c4b21f0..8a0525cb7 100644
--- a/miscutils/less.c
+++ b/miscutils/less.c
@@ -1137,9 +1137,9 @@ static int64_t getch_nowait(void)
#endif
}
- /* We have kbd_fd in O_NONBLOCK mode, read inside read_key()
+ /* We have kbd_fd in O_NONBLOCK mode, read inside safe_read_key()
* would not block even if there is no input available */
- key64 = read_key(kbd_fd, kbd_input, /*timeout off:*/ -2);
+ key64 = safe_read_key(kbd_fd, kbd_input, /*timeout off:*/ -2);
if ((int)key64 == -1) {
if (errno == EAGAIN) {
/* No keyboard input available. Since poll() did return,