Skip to content

Flush output stream after printing state of control lines. - #6

Open
msemeniuk wants to merge 1 commit into
snarlistic:masterfrom
msemeniuk:master
Open

Flush output stream after printing state of control lines.#6
msemeniuk wants to merge 1 commit into
snarlistic:masterfrom
msemeniuk:master

Conversation

@msemeniuk

Copy link
Copy Markdown

Lack of stdout flushing after printing state of control lines causes unpredictable delays when we are going to redirect stdout to file or use pipe to next process.
Testing:
env: Linux Debian bookworm/sid 5.14.0-2-amd64 #1 SMP Debian 5.14.9-2 (2021-10-03) x86_64 GNU/Linux
prereq: USB serial converter or phy serial port

Run ./jpnevulator -t /dev/ttyUSB0 -r -C -g - S -a 1>1.txt, next after 3-5 seconds kill it with ctrl+c
File 1.txt should include something like:

2021-11-14 11:28:53.761480:
le=0, dtr=1, rts=1, st=0, sr=0, cts=0, cd=0, ri=0, dsr=0

1.txt file will be empty without flushing stdout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant