From 28b0b84e7ac805ab5a5c40191012d2739e550c74 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Thu, 26 Feb 2015 16:06:26 +0100 Subject: [PATCH] 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 --- session.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } } -- 2.30.2