diff options
-rw-r--r-- | src/server/tcl_server.c | 2 | ||||
-rw-r--r-- | src/target/target.c | 2 | ||||
-rw-r--r-- | src/target/target.h | 1 |
3 files changed, 3 insertions, 2 deletions
diff --git a/src/server/tcl_server.c b/src/server/tcl_server.c index d6828f12..65f71cc9 100644 --- a/src/server/tcl_server.c +++ b/src/server/tcl_server.c @@ -123,7 +123,7 @@ static int tcl_new_connection(struct connection *connection) memset(tclc, 0, sizeof(struct tcl_connection)); connection->priv = tclc; - struct target *target = get_current_target(connection->cmd_ctx); + struct target *target = get_target_by_num(connection->cmd_ctx->current_target); if (target != NULL) tclc->tc_laststate = target->state; diff --git a/src/target/target.c b/src/target/target.c index 27f8839f..4ea445fe 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -486,7 +486,7 @@ struct target *get_target(const char *id) } /* returns a pointer to the n-th configured target */ -static struct target *get_target_by_num(int num) +struct target *get_target_by_num(int num) { struct target *target = all_targets; diff --git a/src/target/target.h b/src/target/target.h index 9382720b..7471c1b3 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -356,6 +356,7 @@ int target_call_timer_callbacks(void); */ int target_call_timer_callbacks_now(void); +struct target *get_target_by_num(int num); struct target *get_current_target(struct command_context *cmd_ctx); struct target *get_target(const char *id); |