Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Sep 2010 22:10:03 GMT
From:      "Heath N. Caldwell" <hcaldwell@fastsoft.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/110017: [libexec] [patch] serial port console output garbled
Message-ID:  <201009152210.o8FMA3TL079946@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/110017; it has been noted by GNATS.

From: "Heath N. Caldwell" <hcaldwell@fastsoft.com>
To: bug-followup@FreeBSD.org, dan@more.net
Cc: Ji Li <jli@fastsoft.com>
Subject: Re: kern/110017: [libexec] [patch] serial port console output
 garbled
Date: Wed, 15 Sep 2010 14:49:44 -0700

 We ran into this same problem with the PowerEdge 1950 and PowerEdge
 R710.
 
 I spent some time looking at the problem, and it looks like what is
 happening is that oflush() is called right before a case that will end
 up continuing back to the top of the loop, at which time setttymode()
 gets called, which calls tcflush() right off the bat (with TCIOFLUSH).
 So the buffered data is sent, but for at least these machines, it
 doesn't get a chance to be completely written before the call to
 tcflush(), causing it to get into a garbled state.
 
 Here is a patch that uses tcdrain() to make sure that the data is
 completely written to the terminal before returning from oflush().  I
 think that this addresses the problem more directly.
 
 --- getty/main.c	(revision 212627)
 +++ getty/main.c	(working copy)
 @@ -689,8 +689,10 @@
  static void
  oflush(void)
  {
 -	if (obufcnt)
 +	if (obufcnt) {
  		write(STDOUT_FILENO, outbuf, obufcnt);
 +		tcdrain(STDOUT_FILENO);
 +	}
  	obufcnt = 0;
  }
  
 -- 
 Heath Caldwell
 hncaldwell@fastsoft.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009152210.o8FMA3TL079946>