summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-02-03 12:26:10 +0000
committerRoger Dingledine <arma@torproject.org>2006-02-03 12:26:10 +0000
commita1dd751f301268a30223a49436eccab3f2971f8c (patch)
treede8dffb41d7be49526f70f418b1643760d512d8b
parent6f579deff4d18922a8809960cad3838f634c3ee9 (diff)
downloadtor-a1dd751f301268a30223a49436eccab3f2971f8c.tar.gz
tor-a1dd751f301268a30223a49436eccab3f2971f8c.zip
when we fail to bind a listener, try to provide a more useful log msg.
svn:r5900
-rw-r--r--src/or/connection.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 01d8b23014..6f4482e932 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -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;
}