summaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorMatthias Bode <papabaer.embedded@googlemail.com>2010-05-03 22:35:38 +0200
committerØyvind Harboe <oyvind.harboe@zylin.com>2010-05-05 15:24:24 +0200
commit31b050108a1cd740b326dddfa7a2f1322ee8c186 (patch)
tree16c2375739c7970abba58977ef4077fff7c162e6 /src/server
parent91b9f3de0b8e3277ab5c584c6076ddfe491ffc86 (diff)
downloadopenocd+libswd-31b050108a1cd740b326dddfa7a2f1322ee8c186.tar.gz
openocd+libswd-31b050108a1cd740b326dddfa7a2f1322ee8c186.tar.bz2
openocd+libswd-31b050108a1cd740b326dddfa7a2f1322ee8c186.tar.xz
openocd+libswd-31b050108a1cd740b326dddfa7a2f1322ee8c186.zip
Fixed bug in tcl-server
No segmentationfault when sending commands to tcl-server. modified: src/server/server.c modified: src/server/tcl_server.c modified: src/server/tcl_server.h
Diffstat (limited to 'src/server')
-rw-r--r--src/server/server.c2
-rw-r--r--src/server/tcl_server.c6
-rw-r--r--src/server/tcl_server.h2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/server/server.c b/src/server/server.c
index 0d3273b3..7e57228b 100644
--- a/src/server/server.c
+++ b/src/server/server.c
@@ -513,7 +513,7 @@ int server_preinit(void)
int server_init(struct command_context *cmd_ctx)
{
- int ret = tcl_init(cmd_ctx);
+ int ret = tcl_init();
if (ERROR_OK != ret)
return ret;
diff --git a/src/server/tcl_server.c b/src/server/tcl_server.c
index a88c4365..7c8e130b 100644
--- a/src/server/tcl_server.c
+++ b/src/server/tcl_server.c
@@ -81,7 +81,7 @@ static int tcl_new_connection(struct connection *connection)
static int tcl_input(struct connection *connection)
{
- Jim_Interp *interp = (Jim_Interp *)connection->priv;
+ Jim_Interp *interp = (Jim_Interp *)connection->cmd_ctx->interp;
int retval;
int i;
ssize_t rlen;
@@ -157,7 +157,7 @@ static int tcl_closed(struct connection *connection)
return ERROR_OK;
}
-int tcl_init(struct command_context *cmd_ctx)
+int tcl_init(void)
{
int retval;
@@ -169,7 +169,7 @@ int tcl_init(struct command_context *cmd_ctx)
retval = add_service("tcl", CONNECTION_TCP, tcl_port, 1,
&tcl_new_connection, &tcl_input,
- &tcl_closed, cmd_ctx->interp);
+ &tcl_closed, NULL);
return retval;
}
diff --git a/src/server/tcl_server.h b/src/server/tcl_server.h
index 68ad8212..8035a045 100644
--- a/src/server/tcl_server.h
+++ b/src/server/tcl_server.h
@@ -22,7 +22,7 @@
#include <server/server.h>
-int tcl_init(struct command_context *cmd_ctx);
+int tcl_init(void);
int tcl_register_commands(struct command_context *cmd_ctx);
#endif /* _TCL_SERVER_H_ */