Skip to content

Commit

Permalink
Fix compilation with modern compilers
Browse files Browse the repository at this point in the history
Fixes error: jump to label 'try_tcpip' crosses initialization of 'const SOCKET listener'
  • Loading branch information
BtbN authored and bluca committed Nov 24, 2024
1 parent 6089960 commit a23330d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
Expand Down

0 comments on commit a23330d

Please sign in to comment.