diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2022-01-17 03:02:40 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2022-01-17 11:46:23 +0100 |
commit | 12566e7f9b5e5c5d445bc4d36991d134b431dc6c (patch) | |
tree | 2571356a77f7d421da368e9b31dad182e83b2408 /include | |
parent | a277506a64404e6c4472ff89c944c4f353db1c33 (diff) | |
download | busybox-w32-12566e7f9b5e5c5d445bc4d36991d134b431dc6c.tar.gz busybox-w32-12566e7f9b5e5c5d445bc4d36991d134b431dc6c.tar.bz2 busybox-w32-12566e7f9b5e5c5d445bc4d36991d134b431dc6c.zip |
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 'include')
-rw-r--r-- | include/libbb.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/libbb.h b/include/libbb.h index 91b456915..b45ce91c5 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -1908,6 +1908,8 @@ enum { | |||
1908 | * >=0: poll() for TIMEOUT milliseconds, return -1/EAGAIN on timeout | 1908 | * >=0: poll() for TIMEOUT milliseconds, return -1/EAGAIN on timeout |
1909 | */ | 1909 | */ |
1910 | int64_t read_key(int fd, char *buffer, int timeout) FAST_FUNC; | 1910 | int64_t read_key(int fd, char *buffer, int timeout) FAST_FUNC; |
1911 | /* This version loops on EINTR: */ | ||
1912 | int64_t safe_read_key(int fd, char *buffer, int timeout) FAST_FUNC; | ||
1911 | void read_key_ungets(char *buffer, const char *str, unsigned len) FAST_FUNC; | 1913 | void read_key_ungets(char *buffer, const char *str, unsigned len) FAST_FUNC; |
1912 | 1914 | ||
1913 | 1915 | ||
@@ -1961,7 +1963,8 @@ enum { | |||
1961 | USERNAME_COMPLETION = 4 * ENABLE_FEATURE_USERNAME_COMPLETION, | 1963 | USERNAME_COMPLETION = 4 * ENABLE_FEATURE_USERNAME_COMPLETION, |
1962 | VI_MODE = 8 * ENABLE_FEATURE_EDITING_VI, | 1964 | VI_MODE = 8 * ENABLE_FEATURE_EDITING_VI, |
1963 | WITH_PATH_LOOKUP = 0x10, | 1965 | WITH_PATH_LOOKUP = 0x10, |
1964 | FOR_SHELL = DO_HISTORY | TAB_COMPLETION | USERNAME_COMPLETION, | 1966 | LI_INTERRUPTIBLE = 0x20, |
1967 | FOR_SHELL = DO_HISTORY | TAB_COMPLETION | USERNAME_COMPLETION | LI_INTERRUPTIBLE, | ||
1965 | }; | 1968 | }; |
1966 | line_input_t *new_line_input_t(int flags) FAST_FUNC; | 1969 | line_input_t *new_line_input_t(int flags) FAST_FUNC; |
1967 | #if ENABLE_FEATURE_EDITING_SAVEHISTORY | 1970 | #if ENABLE_FEATURE_EDITING_SAVEHISTORY |