]> sigrok.org Git - sigrok-cli.git/commitdiff
cli: flush output on write
authorBert Vermeulen <redacted>
Tue, 26 Jun 2012 21:25:36 +0000 (23:25 +0200)
committerBert Vermeulen <redacted>
Tue, 26 Jun 2012 21:25:36 +0000 (23:25 +0200)
sigrok-cli.c

index ab8296e1317f413ae19c10ad9b9f6ea1ed90085b..a1cb674bcd90ede392b4693dc8e971ef792f8094 100644 (file)
@@ -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);
                        }
                }