Commit a80c4b3f3899b45b6c576e90bd63c79255d1593c

Baptiste 2024-07-25T16:28:02

minor corrections to socket_init_listen

diff --git a/http/socket.c b/http/socket.c
index 161fde5..2cc11a6 100644
--- a/http/socket.c
+++ b/http/socket.c
@@ -99,15 +99,13 @@ p_socket socket_init_listen (p_socket s, const s_str *host,
       error_reason = "socket_init_listen: listen: ";
       goto next;
     }
+    *s = sockfd;
+    return s;
   next:
     res = res->ai_next;
   }
-  if (sockfd < 0) {
-    err_write_1(error_reason);
-    err_puts(strerror(e));
-    assert(! "socket_init_listen");
-    return NULL;
-  }
-  *s = sockfd;
-  return s;
+  err_write_1(error_reason);
+  err_puts(strerror(e));
+  assert(! "socket_init_listen");
+  return NULL;
 }