From 7dbb31e9f6594f0d18ad222094c52945eab67559 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 14 Sep 2000 22:47:29 +0000 Subject: For "askfirst" don't just read one char from stdin, read the whole line using getc(), so that everything before Enter gets discarded. git-svn-id: svn://busybox.net/trunk/busybox@1053 69ca8d6d-28ef-0310-b511-8ec308f3f277 --- init/init.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to '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 -- cgit v1.2.3-55-g6feb