diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-20 22:23:24 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-20 22:23:24 +0000 |
commit | e376d454bb70ed41bbc3eb0358d37fa30c94358d (patch) | |
tree | eb53c600dcde841a7617a19f819ae3e9cfe7fd84 /shell/hush.c | |
parent | ae86a338b89c1339588226cb2298e1785aaa7b90 (diff) | |
download | busybox-w32-e376d454bb70ed41bbc3eb0358d37fa30c94358d.tar.gz busybox-w32-e376d454bb70ed41bbc3eb0358d37fa30c94358d.tar.bz2 busybox-w32-e376d454bb70ed41bbc3eb0358d37fa30c94358d.zip |
libbb: introduce and use nonblock_safe_read(). Yay!
Our shells are immune from this nasty O_NONBLOCK now!
function old new delta
nonblock_safe_read - 78 +78
file_get 276 295 +19
generateMTFValues 428 435 +7
read_line_input 1776 1772 -4
preadbuffer 543 450 -93
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/2 up/down: 104/-97) Total: 7 bytes
text data bss dec hex filename
615190 715 23924 639829 9c355 busybox_old
615168 715 23924 639807 9c33f busybox_unstripped
Diffstat (limited to 'shell/hush.c')
-rw-r--r-- | shell/hush.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/shell/hush.c b/shell/hush.c index 4d4843173..820fd888d 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -1273,10 +1273,10 @@ static void get_user_input(struct in_str *i) | |||
1273 | prompt_str = setup_prompt_string(i->promptmode); | 1273 | prompt_str = setup_prompt_string(i->promptmode); |
1274 | #if ENABLE_FEATURE_EDITING | 1274 | #if ENABLE_FEATURE_EDITING |
1275 | /* Enable command line editing only while a command line | 1275 | /* Enable command line editing only while a command line |
1276 | * is actually being read; otherwise, we'll end up bequeathing | 1276 | * is actually being read */ |
1277 | * atexit() handlers and other unwanted stuff to our | 1277 | do { |
1278 | * child processes (rob@sysgo.de) */ | 1278 | r = read_line_input(prompt_str, user_input_buf, BUFSIZ-1, line_input_state); |
1279 | r = read_line_input(prompt_str, user_input_buf, BUFSIZ-1, line_input_state); | 1279 | } while (r == 0); /* repeat if Ctrl-C */ |
1280 | i->eof_flag = (r < 0); | 1280 | i->eof_flag = (r < 0); |
1281 | if (i->eof_flag) { /* EOF/error detected */ | 1281 | if (i->eof_flag) { /* EOF/error detected */ |
1282 | user_input_buf[0] = EOF; /* yes, it will be truncated, it's ok */ | 1282 | user_input_buf[0] = EOF; /* yes, it will be truncated, it's ok */ |