Skip to content

Commit a23330d

Browse files
BtbNbluca
authored andcommitted
Fix compilation with modern compilers
Fixes error: jump to label 'try_tcpip' crosses initialization of 'const SOCKET listener'
1 parent 6089960 commit a23330d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ip.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,7 @@ int zmq::make_fdpair (fd_t *r_, fd_t *w_)
557557
socklen_t lcladdr_len = sizeof lcladdr;
558558
int rc = 0;
559559
int saved_errno = 0;
560+
SOCKET listener = INVALID_SOCKET;
560561

561562
// It appears that a lack of runtime AF_UNIX support
562563
// can fail in more than one way.
@@ -569,7 +570,7 @@ int zmq::make_fdpair (fd_t *r_, fd_t *w_)
569570
}
570571

571572
// Create a listening socket.
572-
const SOCKET listener = open_socket (AF_UNIX, SOCK_STREAM, 0);
573+
listener = open_socket (AF_UNIX, SOCK_STREAM, 0);
573574
if (listener == retired_fd) {
574575
// This may happen if the library was built on a system supporting AF_UNIX, but the system running doesn't support it.
575576
goto try_tcpip;

0 commit comments

Comments
 (0)