On Thursday 20 January 2011 09:54, Michal Simek wrote:
> Problem was observed on a Xilinx Microblaze system with console on mdm
> IP (which is very slow), where part of the console output wasn't shown.
>
> Calling tcdrain() instead of tcflush() fixes the problem.
But it may lead to a hang if serial line gets mangled:
in some situations tcdrain may wait forever.
I propose adding sleep(1) before the flush.
Can you verify that it works?
> @@ -266,8 +266,8 @@ static void termios_init(struct termios *tp, int speed)
> * reads will be done in raw mode anyway. Errors will be dealt with
> * later on.
> */
> - /* flush input and output queues, important for modems! */
> - tcflush(0, TCIOFLUSH);
> + /* wait until all output written to the stdout has been transmitted */
> + tcdrain(STDOUT_FILENO);
> ispeed = ospeed = speed;
> if (speed == B0) {
> /* Speed was specified as "0" on command line.
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox