summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/system.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2016-01-26 14:46:39 +0000
committerkib <kib@FreeBSD.org>2016-01-26 14:46:39 +0000
commite18e95605fb9a92882e097edc4001cf79441c2c4 (patch)
treeb9801b97657e78930d06d3a9c1b21eee9a81ff37 /lib/libc/stdlib/system.c
parentcd64a150736f4a9f271c0e345a97941128bba948 (diff)
downloadFreeBSD-src-e18e95605fb9a92882e097edc4001cf79441c2c4.zip
FreeBSD-src-e18e95605fb9a92882e097edc4001cf79441c2c4.tar.gz
Don't clear the software flow control flag before draining for last
close or assert the bug that it is clear when leaving. Remove an unrelated rotted comment that was attached to the buggy clearing. Since draining is not done in more cases, flushing is needed in more cases, so start fixing flushing: - do a full flush in ttydisc_close(). State what POSIX requires more clearly. This was missing ttydevsw_pktnotify() calls to tell the devsw layer to flush. Hardware tty drivers don't actually flush since they don't understand this API. - fix 2 missing wakeups in tty_flush(). Most of the wakeups here are unnecessary for last close. But ttydisc_close() did one of the missing ones. This flow control bug ameliorated the design bug of requiring potentially unbounded waits in draining. Software flow control is the easiest way to get an unbounded wait, and a long wait is sometimes actually useful. Users can type the xoff character on the receiver and (if ixon is set on the sender) expect the output to be held until the user is ready for more. Hardware flow control can also give the unbounded wait, and this bug didn't affect hardware flow control. Unbounded waits from hardware flow control take a more unusual configuration. E.g., a terminal program that controls the modem status lines, or unplugging the cable in a configuration where this doesn't break the connection. The design bug is still ameliorated by a newer bug in draining for last close -- the 1 second timeout. E.g., if the user types the xoff character and the sender reaches last close, then output is not resumed and the wait times out after just 1 second. This is broken, but preferable to an unbounded wait. Before this change, the output was resumed immediately and usually completed. Submitted by: bde MFC after: 2 weeks
Diffstat (limited to 'lib/libc/stdlib/system.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud