Merge pull request #85 from riscv/print_port

Print out which port OpenOCD is listening on.
gdb_next_port
Tim Newsome 2017-07-26 07:51:37 -07:00 committed by GitHub
commit 73dee3ad4a
1 changed files with 6 additions and 0 deletions

View File

@ -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);