aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Roskin <proski@gnu.org>2000-09-14 22:47:29 +0000
committerPavel Roskin <proski@gnu.org>2000-09-14 22:47:29 +0000
commitcbe05e45db168fabf807c3cf943a00ff81ec8279 (patch)
tree738121e5b9cf2112feda43faac436aed613ed235
parent7e3bf6e339a2d1e28fc8ee53ca57919f32eba6d6 (diff)
downloadbusybox-cbe05e45db168fabf807c3cf943a00ff81ec8279.tar.gz
For "askfirst" don't just read one char from stdin,
read the whole line using getc(), so that everything before Enter gets discarded.
-rw-r--r--init.c3
-rw-r--r--init/init.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/init.c b/init.c
index 7af8c4a95..7e821f110 100644
--- a/init.c
+++ b/init.c
@@ -448,14 +448,13 @@ static pid_t run(char *command, char *terminal, int get_enter)
* be allowed to start a shell or whatever an init script
* specifies.
*/
- char c;
#ifdef DEBUG_INIT
pid_t shell_pgid = getpid();
message(LOG, "Waiting for enter to start '%s' (pid %d, console %s)\r\n",
command, shell_pgid, terminal);
#endif
write(fileno(stdout), press_enter, sizeof(press_enter) - 1);
- read(fileno(stdin), &c, 1);
+ getc(stdin);
}
#ifdef DEBUG_INIT
diff --git a/init/init.c b/init/init.c
index 7af8c4a95..7e821f110 100644
--- a/init/init.c
+++ b/init/init.c
@@ -448,14 +448,13 @@ static pid_t run(char *command, char *terminal, int get_enter)
* be allowed to start a shell or whatever an init script
* specifies.
*/
- char c;
#ifdef DEBUG_INIT
pid_t shell_pgid = getpid();
message(LOG, "Waiting for enter to start '%s' (pid %d, console %s)\r\n",
command, shell_pgid, terminal);
#endif
write(fileno(stdout), press_enter, sizeof(press_enter) - 1);
- read(fileno(stdin), &c, 1);
+ getc(stdin);
}
#ifdef DEBUG_INIT