input: Call input_init on first use
PATCH 1/1 input: Call input_init on first use
When the shell is used to execute another utility, it makes no sense to initialise stdin, which costs up to two system calls.
Since the input layer can already handle first-use initialisation because of reset_init, simply make this always the case.
Signed-off-by Herbert Xu <[email protected]>
src/input.c +1 -3
@@ -77,7 +77,7 @@ MKINIT struct parsefile *toppf = &basepf; MKINIT struct stdin_state stdin_state;struct parsefile *parsefile = &basepf;/* current input file */ int whichprompt;/* 1 == PS1, 2 == PS2 */ -int stdin_istty; +int stdin_istty =-1 ; MKINIT void input_init(void);
@@ -99,8 +99,6 @@ INCLUDE "syntax.h" INIT { basepf.nextc = basepf.buf = basebuf; basepf.linno = 1; - - input_init(); } RESET {
--
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt