session.c: Indicate the error type when --config --set fails.
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Thu, 26 Feb 2015 15:06:26 +0000 (16:06 +0100)
committerUwe Hermann <uwe@hermann-uwe.de>
Fri, 27 Feb 2015 13:45:01 +0000 (14:45 +0100)
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 <bgolaszewski@baylibre.com>
session.c

index d3c7e01d3389f0676b47d277836aa109460b6353..090fdce8f32fea1b408f25e6199ff446d2472db1 100644 (file)
--- 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;
                }
        }