aboutsummaryrefslogtreecommitdiff
path: root/libbb/lineedit.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-02-20 22:23:24 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-02-20 22:23:24 +0000
commite376d454bb70ed41bbc3eb0358d37fa30c94358d (patch)
treeeb53c600dcde841a7617a19f819ae3e9cfe7fd84 /libbb/lineedit.c
parentae86a338b89c1339588226cb2298e1785aaa7b90 (diff)
downloadbusybox-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 'libbb/lineedit.c')
-rw-r--r--libbb/lineedit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index 529344f6c..9aab63702 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -1408,9 +1408,9 @@ int read_line_input(const char *prompt, char *command, int maxsize, line_input_t
1408 parse_and_put_prompt(prompt); 1408 parse_and_put_prompt(prompt);
1409 1409
1410 while (1) { 1410 while (1) {
1411 fflush(stdout); 1411 fflush(NULL);
1412 1412
1413 if (safe_read(STDIN_FILENO, &c, 1) < 1) { 1413 if (nonblock_safe_read(STDIN_FILENO, &c, 1) < 1) {
1414 /* if we can't read input then exit */ 1414 /* if we can't read input then exit */
1415 goto prepare_to_die; 1415 goto prepare_to_die;
1416 } 1416 }