Ticket #606 (closed defect: fixed)
libgsmd-tool buffers its output
| Reported by: | pavel@… | Owned by: | laforge@… |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | gsmd | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: | buglog@… | Blocked By: | |
| Blocking: | Estimated Completion (week): | ||
| HasPatchForReview: | PatchReviewResult: | ||
| Reproducible: |
Description
...making it unusable for scripting. Try libgsmd-tool -m shell | cat , then call
yourself. You'll only see the events when you press C.
I guess setvbuf() to line buffered at strategic place would be good idea?
Attachments
Change History
comment:2 Changed 6 years ago by pavel@…
Actually, it is probably better to just stick fflush(stdout)
while (1) {
fd_set readset;
int gsm_fd = lgsm_fd(lgsmh);
FD_SET(0, &readset);
FD_SET(gsm_fd, &readset);
rc = select(gsm_fd+1, &readset, NULL, NULL, NULL);
if (rc <= 0)
break;
...just before the select() in shell.c
Note: See
TracTickets for help on using
tickets.

I guess this is the minimally-intrusive way to fix it.