From ed38a4102e5964cf720d339f54bc52b9d241e799 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Tue, 30 Jul 2013 11:19:33 +0100 Subject: [PATCH] showing error string as well as numeric error on bind failure --- mongoose.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mongoose.c b/mongoose.c index 92eead63..fe6de678 100644 --- a/mongoose.c +++ b/mongoose.c @@ -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,