nofork: fix a bug uncovered by hush testsuite (forgotten fflush)

function                                             old     new   delta
run_nofork_applet                                    280     287      +7

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2017-08-03 19:52:47 +02:00
parent 72d725d7cc
commit 19c9f31af1
2 changed files with 3 additions and 1 deletions

View File

@ -143,6 +143,8 @@ int FAST_FUNC run_nofork_applet(int applet_no, char **argv)
applet_name = tmp_argv[0];
/* Finally we can call NOFORK applet's main() */
rc = applet_main[applet_no](argc, tmp_argv);
/* Important for shells: `which CMD` was failing */
fflush_all();
} else {
/* xfunc died in NOFORK applet */
}

View File

@ -80,7 +80,7 @@ do_test()
case $? in
0) echo " ok";;
77) echo " skip (feature disabled)";;
*) echo " fail"; tret=1;;
*) echo " fail ($?)"; tret=1;;
esac
done
exit ${tret}