From 9225ab1ecc55992a05c4be4af44a3d6193a6507c Mon Sep 17 00:00:00 2001 From: Daniel Willmann Date: Thu, 28 Jul 2011 21:38:51 +0200 Subject: libctrl: Don't overwrite error reply if the verify function sets one --- openbsc/src/libctrl/control_cmd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'openbsc/src') 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) { -- cgit v1.2.3