mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-29 04:53:56 +08:00
from Mat Hostetter <mat@lcs.mit.edu>
* remote-utils.c (remote_open): Print out the assigned port number.
This commit is contained in:
parent
c499ed39b6
commit
6f8486daac
@ -1,3 +1,7 @@
|
||||
2007-02-26 Mat Hostetter <mat@lcs.mit.edu>
|
||||
|
||||
* remote-utils.c (remote_open): Print out the assigned port number.
|
||||
|
||||
2007-02-26 Daniel Jacobowitz <dan@codesourcery.com>
|
||||
|
||||
* remote-utils.c (monitor_output): New function.
|
||||
|
@ -209,6 +209,17 @@ remote_open (char *name)
|
||||
|| listen (tmp_desc, 1))
|
||||
perror_with_name ("Can't bind address");
|
||||
|
||||
/* If port is zero, a random port will be selected, and the
|
||||
fprintf below needs to know what port was selected. */
|
||||
if (port == 0)
|
||||
{
|
||||
socklen_t len = sizeof (sockaddr);
|
||||
if (getsockname (tmp_desc, (struct sockaddr *) &sockaddr, &len) < 0
|
||||
|| len < sizeof (sockaddr))
|
||||
perror_with_name ("Can't determine port");
|
||||
port = ntohs (sockaddr.sin_port);
|
||||
}
|
||||
|
||||
fprintf (stderr, "Listening on port %d\n", port);
|
||||
fflush (stderr);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user