mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-09-21 05:26:20 +02:00
when we fail to bind a listener, try to provide a more useful log msg.
svn:r5900
This commit is contained in:
parent
6f579deff4
commit
a1dd751f30
@ -547,8 +547,12 @@ connection_create_listener(const char *listenaddress, uint16_t listenport,
|
||||
#endif
|
||||
|
||||
if (bind(s,(struct sockaddr *)&listenaddr,sizeof(listenaddr)) < 0) {
|
||||
warn(LD_NET, "Could not bind to %s:%u: %s", address, usePort,
|
||||
tor_socket_strerror(tor_socket_errno(s)));
|
||||
char *helpfulhint = "";
|
||||
int e = tor_socket_errno(s);
|
||||
if (ERRNO_IS_EADDRINUSE(e))
|
||||
helpfulhint = ". Is Tor already running?";
|
||||
warn(LD_NET, "Could not bind to %s:%u: %s%s", address, usePort,
|
||||
tor_socket_strerror(e), helpfulhint);
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user