Print out which port OpenOCD is listening on.
This is essential when a test environment asks OpenOCD to listen on port 0, so that the environment can easily discover which port is actually being used.
This commit is contained in:
parent
79329f21a3
commit
753d15e22c
|
@ -298,6 +298,12 @@ int add_service(char *name,
|
|||
free_service(c);
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
|
||||
struct sockaddr_in addr_in;
|
||||
socklen_t addr_in_size = sizeof(addr_in);
|
||||
getsockname(c->fd, &addr_in, &addr_in_size);
|
||||
LOG_INFO("Listening on port %d for %s connections",
|
||||
ntohs(addr_in.sin_port), name);
|
||||
} else if (c->type == CONNECTION_STDINOUT) {
|
||||
c->fd = fileno(stdin);
|
||||
|
||||
|
|
Loading…
Reference in New Issue