[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Log errno on listener socket creation failure.
commit 2394c7401769c56226bd95b70f9b85928a3017de
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Thu Sep 15 09:51:48 2011 -0400
Log errno on listener socket creation failure.
This may help diagnose bug 4027.
---
changes/4027-diagnose | 4 ++++
src/or/connection.c | 3 ++-
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/changes/4027-diagnose b/changes/4027-diagnose
new file mode 100644
index 0000000..3fb6bd0
--- /dev/null
+++ b/changes/4027-diagnose
@@ -0,0 +1,4 @@
+ o Minor features (diagnostics):
+ - When the system call to create a listener socket fails, log the
+ error message explaining why. This may help diagnose bug 4027.
+
diff --git a/src/or/connection.c b/src/or/connection.c
index 790383b..0092030 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -891,7 +891,8 @@ connection_create_listener(const struct sockaddr *listensockaddr,
is_tcp ? SOCK_STREAM : SOCK_DGRAM,
is_tcp ? IPPROTO_TCP: IPPROTO_UDP);
if (!SOCKET_OK(s)) {
- log_warn(LD_NET,"Socket creation failed.");
+ log_warn(LD_NET,"Socket creation failed: %s",
+ tor_socket_strerror(tor_socket_errno(-1)));
goto err;
}
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits