aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSpencer Oliver <spen@spen-soft.co.uk>2012-08-21 11:10:18 +0100
committerFreddie Chopin <freddie.chopin@gmail.com>2012-08-29 06:42:52 +0000
commit210ff6028480df93f483131d6c6ca1f7f372aa2a (patch)
treed9e212c9457f52053865fd1da1efc4bf59a9662c /src
parent9a8aa4ec63ff2d869d0ddf29b73afd5524bc77de (diff)
server: warn if user changes server port after init
So the user can view the current port number these cmds were changed to COMMAND_ANY. However this means that the user can also attempt to change the port number after init, even though this is not supported. Issue a warning that this is not supported. Change-Id: I3d20dcd81277e7d994240a8e314f27672ff760c4 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/788 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/server/server.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/server/server.c b/src/server/server.c
index 16f75107..96f06b3f 100644
--- a/src/server/server.c
+++ b/src/server/server.c
@@ -635,6 +635,10 @@ SERVER_PIPE_COMMAND()
break;
case 1:
{
+ if (CMD_CTX->mode == COMMAND_EXEC) {
+ LOG_WARNING("unable to change server port after init");
+ return ERROR_COMMAND_ARGUMENT_INVALID;
+ }
const char *t = strdup(CMD_ARGV[0]);
free((void *)*out);
*out = t;