aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libctrl
diff options
context:
space:
mode:
authorDaniel Willmann <daniel@totalueberwachung.de>2011-07-28 21:38:51 +0200
committerHarald Welte <laforge@gnumonks.org>2014-08-21 15:34:13 +0200
commit9225ab1ecc55992a05c4be4af44a3d6193a6507c (patch)
treece5f97123b29dba2837491afd12249e96f94a11b /openbsc/src/libctrl
parentf7c74e58799850661b34b81137b994993a40ddd2 (diff)
libctrl: Don't overwrite error reply if the verify function sets one
Diffstat (limited to 'openbsc/src/libctrl')
-rw-r--r--openbsc/src/libctrl/control_cmd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/openbsc/src/libctrl/control_cmd.c b/openbsc/src/libctrl/control_cmd.c
index 818c0d57..7a75e0e2 100644
--- a/openbsc/src/libctrl/control_cmd.c
+++ b/openbsc/src/libctrl/control_cmd.c
@@ -137,7 +137,9 @@ int ctrl_cmd_exec(vector vline, struct ctrl_cmd *command, vector node, void *dat
if (cmd_el->verify) {
if ((ret = cmd_el->verify(command, command->value, data))) {
ret = CTRL_CMD_ERROR;
- command->reply = "Value failed verification.";
+ /* If verify() set an appropriate error message, don't change it. */
+ if (!command->reply)
+ command->reply = "Value failed verification.";
goto out;
}
} else if (cmd_el->param) {