From: Bartosz Golaszewski Date: Thu, 26 Feb 2015 15:06:26 +0000 (+0100) Subject: session.c: Indicate the error type when --config --set fails. X-Git-Tag: sigrok-cli-0.6.0~40 X-Git-Url: http://sigrok.org/gitweb/?p=sigrok-cli.git;a=commitdiff_plain;h=28b0b84e7ac805ab5a5c40191012d2739e550c74;hp=15db66c6a90ea967264b66b80d381b89847e3afa session.c: Indicate the error type when --config --set fails. When sigrok-cli fails to set a config option it doesn't indicate the actual error as opposed to --get. Print the error message in both cases. Signed-off-by: Bartosz Golaszewski --- diff --git a/session.c b/session.c index d3c7e01..090fdce 100644 --- a/session.c +++ b/session.c @@ -478,7 +478,8 @@ int set_dev_options(struct sr_dev_inst *sdi, GHashTable *args) cg = select_channel_group(sdi); if ((ret = maybe_config_set(sr_dev_inst_driver_get(sdi), sdi, cg, src.key, src.data)) != SR_OK) { - g_critical("Failed to set device option '%s'.", (char *)key); + g_critical("Failed to set device option '%s': %s.", + (char *)key, sr_strerror(ret)); return ret; } }