aboutsummaryrefslogtreecommitdiff
path: root/shell/msh.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/msh.c')
-rw-r--r--shell/msh.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/shell/msh.c b/shell/msh.c
index 230d74f5a..8f046e794 100644
--- a/shell/msh.c
+++ b/shell/msh.c
@@ -682,8 +682,7 @@ static void * brkaddr;
#ifdef BB_FEATURE_COMMAND_EDITING
-char * current_prompt;
-unsigned int shell_context;
+static char * current_prompt;
#endif
@@ -4449,9 +4448,7 @@ register struct ioarg *ap;
if ((i = ap->afid != bp->id) || bp->bufp == bp->ebufp) {
if (i)
lseek(ap->afile, ap->afpos, 0);
- do {
- i = read(ap->afile, bp->buf, sizeof(bp->buf));
- } while (i < 0 && errno == EINTR);
+ i = safe_read(ap->afile, bp->buf, sizeof(bp->buf));
if (i <= 0) {
closef(ap->afile);
return 0;
@@ -4470,7 +4467,6 @@ register struct ioarg *ap;
while (size == 0 || position >= size) {
cmdedit_read_input(current_prompt, mycommand);
- cmdedit_terminate();
size = strlen(mycommand);
position = 0;
}
@@ -4480,9 +4476,7 @@ register struct ioarg *ap;
} else
#endif
{
- do {
- i = read(ap->afile, &c, sizeof(c));
- } while (i < 0 && errno == EINTR);
+ i = safe_read(ap->afile, &c, sizeof(c));
return(i == sizeof(c)? c&0177: (closef(ap->afile), 0));
}
}