From: Bert Vermeulen Date: Tue, 26 Jun 2012 21:25:36 +0000 (+0200) Subject: cli: flush output on write X-Git-Tag: sigrok-cli-0.4.0~100 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=e09810e97db06458814a9e19e78988e7f1515c9e;p=sigrok-cli.git cli: flush output on write --- diff --git a/sigrok-cli.c b/sigrok-cli.c index ab8296e..a1cb674 100644 --- a/sigrok-cli.c +++ b/sigrok-cli.c @@ -583,6 +583,7 @@ static void datafeed_in(struct sr_dev *dev, struct sr_datafeed_packet *packet) o->format->data(o, filter_out, filter_out_len, &output_buf, &output_len); if (output_buf) { fwrite(output_buf, 1, output_len, outfile); + fflush(outfile); g_free(output_buf); } } @@ -638,6 +639,7 @@ static void datafeed_in(struct sr_dev *dev, struct sr_datafeed_packet *packet) &output_buf, &output_len); if (output_buf) { fwrite(output_buf, 1, output_len, outfile); + fflush(outfile); g_free(output_buf); } } @@ -652,6 +654,7 @@ static void datafeed_in(struct sr_dev *dev, struct sr_datafeed_packet *packet) &output_len); if (output_buf) { fwrite(output_buf, 1, output_len, outfile); + fflush(outfile); g_free(output_buf); } } @@ -664,6 +667,7 @@ static void datafeed_in(struct sr_dev *dev, struct sr_datafeed_packet *packet) &output_len); if (output_buf) { fwrite(output_buf, 1, output_len, outfile); + fflush(outfile); g_free(output_buf); } }