]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Log errno on listener socket creation failure.
authorNick Mathewson <nickm@torproject.org>
Thu, 15 Sep 2011 13:51:48 +0000 (09:51 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 15 Sep 2011 13:51:48 +0000 (09:51 -0400)
This may help diagnose bug 4027.

changes/4027-diagnose [new file with mode: 0644]
src/or/connection.c

diff --git a/changes/4027-diagnose b/changes/4027-diagnose
new file mode 100644 (file)
index 0000000..3fb6bd0
--- /dev/null
@@ -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.
+
index 790383b184fb0b5c48c068cb5ccc28fa8586cc9e..009203095e438a84b62ec4aa45bb89833548bf59 100644 (file)
@@ -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;
     }