0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-25 14:20:52 +08:00

Fix compilation with modern compilers

Fixes error: jump to label 'try_tcpip' crosses initialization of 'const SOCKET listener'
This commit is contained in:
BtbN 2024-11-24 20:22:18 +01:00 committed by Luca Boccassi
parent 60899603a4
commit a23330dbe2

View File

@ -557,6 +557,7 @@ int zmq::make_fdpair (fd_t *r_, fd_t *w_)
socklen_t lcladdr_len = sizeof lcladdr;
int rc = 0;
int saved_errno = 0;
SOCKET listener = INVALID_SOCKET;
// It appears that a lack of runtime AF_UNIX support
// can fail in more than one way.
@ -569,7 +570,7 @@ int zmq::make_fdpair (fd_t *r_, fd_t *w_)
}
// Create a listening socket.
const SOCKET listener = open_socket (AF_UNIX, SOCK_STREAM, 0);
listener = open_socket (AF_UNIX, SOCK_STREAM, 0);
if (listener == retired_fd) {
// This may happen if the library was built on a system supporting AF_UNIX, but the system running doesn't support it.
goto try_tcpip;