Commit ed38a410 authored by Sergey Lyubka's avatar Sergey Lyubka

showing error string as well as numeric error on bind failure

parent 2e93cde9
......@@ -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 ?
sizeof(so.lsa.sin) : sizeof(so.lsa)) != 0 ||
listen(so.sock, SOMAXCONN) != 0) {
cry(fc(ctx), "%s: cannot bind to %.*s: %d", __func__,
(int) vec.len, vec.ptr, ERRNO);
cry(fc(ctx), "%s: cannot bind to %.*s: %d (%s)", __func__,
(int) vec.len, vec.ptr, ERRNO, strerror(errno));
closesocket(so.sock);
success = 0;
} else if ((ptr = realloc(ctx->listening_sockets,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment