More diagnostics when socket() fails.
authorEmil Mikulic <emikulic@gmail.com>
Mon, 23 Jan 2012 01:52:50 +0000 (17:52 -0800)
committerEmil Mikulic <emikulic@gmail.com>
Mon, 23 Jan 2012 01:52:50 +0000 (17:52 -0800)
http.c

diff --git a/http.c b/http.c
index fa77183..8d46e03 100644 (file)
--- a/http.c
+++ b/http.c
@@ -917,7 +917,8 @@ static void http_listen_one(struct addrinfo *ai,
     /* create incoming socket */
     if ((sockin = socket(ai->ai_family, ai->ai_socktype,
             ai->ai_protocol)) == -1)
-        err(1, "socket() failed");
+        err(1, "socket(%d, %d, %d) failed",
+          ai->ai_family, ai->ai_socktype,  ai->ai_protocol);
 
     /* reuse address */
     sockopt = 1;