Menu

#11 Patch to fix TIOCSERGETLSR bug (5.05)

open
nobody
None
5
2001-05-25
2001-05-25
Ian Abbott
No

This is a patch to fix a bug in serial-5.05.

The get_lsr_info() function used to get the result for
the TIOCSERGETLSR ioctl has a bug. The line that reads:

result &= TIOCSER_TEMT;

should read:

result |= TIOCSER_TEMT;

The effect of the bug is to render the second condition
for returning with the TIOCSER_TEMT bit set in the
result ineffective. (The first condition is checking if
the UART's transmitter is idle; the second condition is
checking if the UART's THR register is about to be
written.)

Discussion

  • Ian Abbott

    Ian Abbott - 2001-05-25

    Serial 5.05 patch to fix TIOCSERGETLSR bug

     
  • Ian Abbott

    Ian Abbott - 2001-05-29

    Revised serial 5.05 patch to fix TIOCSERGETLSR bug

     
  • Ian Abbott

    Ian Abbott - 2001-05-29

    Logged In: YES
    user_id=141198

    Sorry, I mucked that up. The line should read as follows:

    result &= ~TIOCSER_TEMT;

    I.e. we want to clear the TIOCSER_TEMT bit in the result if
    the second condition is true, NOT set it!