Fix unix sockets support on Windows

Closes #3511. Thanks to lt-havoc.
This commit is contained in:
Roger A. Light
2026-02-23 23:16:20 +00:00
parent 7a1905006a
commit f5dd5d8519
3 changed files with 3 additions and 2 deletions

View File

@@ -30,6 +30,7 @@
- Fix test when nbuilding with WITH_EDITLINE=no. Closes #3484. - Fix test when nbuilding with WITH_EDITLINE=no. Closes #3484.
- Fix tests when building with WITH_WEBSOCKETS=no. Closes #3502. - Fix tests when building with WITH_WEBSOCKETS=no. Closes #3502.
- Fix libmosquitto_static cmake build. - Fix libmosquitto_static cmake build.
- Enable WITH_UNIX_SOCKETS on Windows.
2.1.2 - 2026-02-09 2.1.2 - 2026-02-09

View File

@@ -187,7 +187,7 @@ int mosquitto_reconnect(struct mosquitto *mosq)
} }
int get_address(int sock, char *buf, size_t len, uint16_t *remote_port) int get_address(mosq_sock_t sock, char *buf, size_t len, uint16_t *remote_port)
{ {
struct sockaddr_storage addr; struct sockaddr_storage addr;
socklen_t addrlen; socklen_t addrlen;

View File

@@ -938,7 +938,7 @@ static int net__socket_listen_tcp(struct mosquitto__listener *listener)
static int net__socket_listen_unix(struct mosquitto__listener *listener) static int net__socket_listen_unix(struct mosquitto__listener *listener)
{ {
struct sockaddr_un addr; struct sockaddr_un addr;
int sock; mosq_sock_t sock = INVALID_SOCKET;
int rc; int rc;
#ifndef WIN32 #ifndef WIN32
mode_t old_mask; mode_t old_mask;