mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-27 20:48:29 +00:00
showing error string as well as numeric error on bind failure
This commit is contained in:
1 parent
2e93cde929
commit
ed38a4102e
1 file changed
+2
-2
+2
-2
@@ -4577,8 +4577,8 @@ static int set_ports_option(struct mg_context *ctx) {
|
|||||||
bind(so.sock, &so.lsa.sa, so.lsa.sa.sa_family == AF_INET ?
|
bind(so.sock, &so.lsa.sa, so.lsa.sa.sa_family == AF_INET ?
|
||||||
sizeof(so.lsa.sin) : sizeof(so.lsa)) != 0 ||
|
sizeof(so.lsa.sin) : sizeof(so.lsa)) != 0 ||
|
||||||
listen(so.sock, SOMAXCONN) != 0) {
|
listen(so.sock, SOMAXCONN) != 0) {
|
||||||
cry(fc(ctx), "%s: cannot bind to %.*s: %d", __func__,
|
cry(fc(ctx), "%s: cannot bind to %.*s: %d (%s)", __func__,
|
||||||
(int) vec.len, vec.ptr, ERRNO);
|
(int) vec.len, vec.ptr, ERRNO, strerror(errno));
|
||||||
closesocket(so.sock);
|
closesocket(so.sock);
|
||||||
success = 0;
|
success = 0;
|
||||||
} else if ((ptr = realloc(ctx->listening_sockets,
|
} else if ((ptr = realloc(ctx->listening_sockets,
|
||||||
|
|||||||
Reference in new issue
Block a user