diff --git a/mongoose.c b/mongoose.c index e1871067..b7ceadd4 100644 --- a/mongoose.c +++ b/mongoose.c @@ -3027,7 +3027,7 @@ SOCKET mg_open_listener(const char *url, struct mg_addr *addr) { } } if (fd == INVALID_SOCKET) { - if (s_err = 0) s_err = MG_SOCK_ERRNO; + if (s_err == 0) s_err = MG_SOCK_ERRNO; LOG(LL_ERROR, ("Failed to listen on %s, errno %d", url, s_err)); } diff --git a/src/sock.c b/src/sock.c index 4accc934..028e28f0 100644 --- a/src/sock.c +++ b/src/sock.c @@ -181,7 +181,7 @@ SOCKET mg_open_listener(const char *url, struct mg_addr *addr) { } } if (fd == INVALID_SOCKET) { - if (s_err = 0) s_err = MG_SOCK_ERRNO; + if (s_err == 0) s_err = MG_SOCK_ERRNO; LOG(LL_ERROR, ("Failed to listen on %s, errno %d", url, s_err)); }