Patch to fix TIOCSERGETLSR bug (5.05)
Brought to you by:
tytso
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.)
Serial 5.05 patch to fix TIOCSERGETLSR bug
Revised serial 5.05 patch to fix TIOCSERGETLSR bug
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!