mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Fix output-line-delay behavior
If output-line-delay is non-zero and output-delay is any, line delay time set output-line-delay. If output-line-delay is zero and output-delay is non-zero, line delay time set output-delay. It was previously (output-line-delay + output-delay) in any case. Also, since the buffer was flushed after the line delay, there was a possibility that the delay would be reduced or not applied at all.
This commit is contained in:
parent
9784d3c277
commit
3922ce3447
1 changed files with 4 additions and 5 deletions
|
|
@ -283,15 +283,14 @@ ssize_t tty_write(int fd, const void *buffer, size_t count)
|
|||
}
|
||||
bytes_written += retval;
|
||||
|
||||
fsync(fd);
|
||||
tcdrain(fd);
|
||||
|
||||
if (option.output_line_delay && *(unsigned char*)buffer == '\n')
|
||||
{
|
||||
delay(option.output_line_delay);
|
||||
}
|
||||
|
||||
fsync(fd);
|
||||
tcdrain(fd);
|
||||
|
||||
if (option.output_delay)
|
||||
else if (option.output_delay)
|
||||
{
|
||||
delay(option.output_delay);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue