diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-05-08 21:23:43 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-05-08 21:23:43 +0200 |
commit | 80542bad2f1df9d99b579c9eeb3c2675c14c72c0 (patch) | |
tree | 906cdea5609e0272fda16dc02caa3c683912c228 /shell/ash.c | |
parent | 80c5b6893d4708b3683ad9a51c990a326a8f1dff (diff) | |
download | busybox-w32-80542bad2f1df9d99b579c9eeb3c2675c14c72c0.tar.gz busybox-w32-80542bad2f1df9d99b579c9eeb3c2675c14c72c0.tar.bz2 busybox-w32-80542bad2f1df9d99b579c9eeb3c2675c14c72c0.zip |
hush: make read builtin interruptible.
function old new delta
builtin_read 185 471 +286
check_and_run_traps 200 262 +62
nonblock_immune_read 73 119 +46
sigismember - 44 +44
record_signal - 21 +21
sigisemptyset - 16 +16
...
------------------------------------------------------------------------------
(add/remove: 5/0 grow/shrink: 7/5 up/down: 483/-46) Total: 437 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash.c')
-rw-r--r-- | shell/ash.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c index b1b11bd1b..d48cd016f 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -5918,7 +5918,7 @@ expbackq(union node *cmd, int quoted, int quotes) | |||
5918 | read: | 5918 | read: |
5919 | if (in.fd < 0) | 5919 | if (in.fd < 0) |
5920 | break; | 5920 | break; |
5921 | i = nonblock_immune_read(in.fd, buf, sizeof(buf)); | 5921 | i = nonblock_immune_read(in.fd, buf, sizeof(buf), /*loop_on_EINTR:*/ 1); |
5922 | TRACE(("expbackq: read returns %d\n", i)); | 5922 | TRACE(("expbackq: read returns %d\n", i)); |
5923 | if (i <= 0) | 5923 | if (i <= 0) |
5924 | break; | 5924 | break; |
@@ -9617,7 +9617,7 @@ preadfd(void) | |||
9617 | #if ENABLE_FEATURE_EDITING | 9617 | #if ENABLE_FEATURE_EDITING |
9618 | retry: | 9618 | retry: |
9619 | if (!iflag || g_parsefile->pf_fd != STDIN_FILENO) | 9619 | if (!iflag || g_parsefile->pf_fd != STDIN_FILENO) |
9620 | nr = nonblock_immune_read(g_parsefile->pf_fd, buf, IBUFSIZ - 1); | 9620 | nr = nonblock_immune_read(g_parsefile->pf_fd, buf, IBUFSIZ - 1, /*loop_on_EINTR:*/ 1); |
9621 | else { | 9621 | else { |
9622 | int timeout = -1; | 9622 | int timeout = -1; |
9623 | # if ENABLE_ASH_IDLE_TIMEOUT | 9623 | # if ENABLE_ASH_IDLE_TIMEOUT |
@@ -9663,7 +9663,7 @@ preadfd(void) | |||
9663 | } | 9663 | } |
9664 | } | 9664 | } |
9665 | #else | 9665 | #else |
9666 | nr = nonblock_immune_read(g_parsefile->pf_fd, buf, IBUFSIZ - 1); | 9666 | nr = nonblock_immune_read(g_parsefile->pf_fd, buf, IBUFSIZ - 1, /*loop_on_EINTR:*/ 1); |
9667 | #endif | 9667 | #endif |
9668 | 9668 | ||
9669 | #if 0 /* disabled: nonblock_immune_read() handles this problem */ | 9669 | #if 0 /* disabled: nonblock_immune_read() handles this problem */ |