]> sigrok.org Git - sigrok-cli.git/blobdiff - sigrok-cli.c
cli: flush output on write
[sigrok-cli.git] / 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);
                        }
                }