[klibc] kinit: before exiting, tcdrain() any output

If kinit returns, the kernel will usually panic.  Often the serial port
driver will not flush data out the port before it does so.  Do tcdrain()
on file descriptors 2 and 1 before exiting, so the user has a better
chance of seeing the error.

After a bug report from Bjorn Helgaas <bjorn.helgaas@hp.com>.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
1 file changed