The following reply was made to PR kern/110017; it has been noted by GNATS.

From: "Heath N. Caldwell" <[email protected]>
To: [email protected], [email protected]
Cc: Ji Li <[email protected]>
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
 [email protected]
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to