cli: halt session if SRD session fails to initialize
authorBert Vermeulen <bert@biot.com>
Sun, 27 May 2012 17:30:30 +0000 (19:30 +0200)
committerBert Vermeulen <bert@biot.com>
Sun, 27 May 2012 17:30:30 +0000 (19:30 +0200)
sigrok-cli.c

index f13289e56d38ade95f937b6b32df23d974e39628..87b421c91b3e3637dfbf24e14d9731516078e0c3 100644 (file)
@@ -385,9 +385,11 @@ static void datafeed_in(struct sr_dev *dev, struct sr_datafeed_packet *packet)
                                outfile = g_fopen(opt_output_file, "wb");
                        }
                }
-               if (opt_pds)
-                       srd_session_start(num_enabled_probes, unitsize,
-                                       header->samplerate);
+               if (opt_pds) {
+                       if (srd_session_start(num_enabled_probes, unitsize,
+                                       header->samplerate) != SRD_OK)
+                               sr_session_halt();
+               }
                break;
        case SR_DF_END:
                g_debug("cli: Received SR_DF_END");