Ticket #606 (closed defect: fixed)

Opened 12 years ago

Last modified 12 years ago

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

delme (769 bytes) - added by pavel@… 12 years ago.
possible fix, compile-tested

Change History

comment:1 Changed 12 years ago by pavel@…

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

Changed 12 years ago by pavel@…

possible fix, compile-tested

comment:2 Changed 12 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

comment:3 Changed 12 years ago by jluebbe@…

  • Status changed from new to assigned

comment:4 Changed 12 years ago by jluebbe@…

I've committed a fix in revision 2381.

comment:5 Changed 12 years ago by jluebbe@…

  • Status changed from assigned to closed
  • Resolution set to fixed

I've committed a fix in revision 2381.

Note: See TracTickets for help on using tickets.