From: Bert Vermeulen Date: Sun, 27 May 2012 17:30:30 +0000 (+0200) Subject: cli: halt session if SRD session fails to initialize X-Git-Tag: sigrok-cli-0.3.1~17 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=3a999920eb5fa7edd95b9a67b58cdbd653f52f5a;p=sigrok-cli.git cli: halt session if SRD session fails to initialize --- diff --git a/sigrok-cli.c b/sigrok-cli.c index f13289e..87b421c 100644 --- a/sigrok-cli.c +++ b/sigrok-cli.c @@ -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");