Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
61f9e71e
Commit
61f9e71e
authored
Jul 30, 2016
by
Constantin Rack
Committed by
GitHub
Jul 30, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2069 from hjp/master
parents
5e684172
e175fe21
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
ipc_listener.cpp
src/ipc_listener.cpp
+5
-1
tcp_listener.cpp
src/tcp_listener.cpp
+5
-1
No files found.
src/ipc_listener.cpp
View file @
61f9e71e
...
@@ -390,7 +390,11 @@ zmq::fd_t zmq::ipc_listener_t::accept ()
...
@@ -390,7 +390,11 @@ zmq::fd_t zmq::ipc_listener_t::accept ()
// The situation where connection cannot be accepted due to insufficient
// The situation where connection cannot be accepted due to insufficient
// resources is considered valid and treated by ignoring the connection.
// resources is considered valid and treated by ignoring the connection.
zmq_assert
(
s
!=
retired_fd
);
zmq_assert
(
s
!=
retired_fd
);
#if defined ZMQ_HAVE_SOCK_CLOEXEC
fd_t
sock
=
::
accept4
(
s
,
(
struct
sockaddr
*
)
&
ss
,
&
ss_len
,
SOCK_CLOEXEC
);
#else
fd_t
sock
=
::
accept
(
s
,
NULL
,
NULL
);
fd_t
sock
=
::
accept
(
s
,
NULL
,
NULL
);
#endif
if
(
sock
==
-
1
)
{
if
(
sock
==
-
1
)
{
errno_assert
(
errno
==
EAGAIN
||
errno
==
EWOULDBLOCK
||
errno_assert
(
errno
==
EAGAIN
||
errno
==
EWOULDBLOCK
||
errno
==
EINTR
||
errno
==
ECONNABORTED
||
errno
==
EPROTO
||
errno
==
EINTR
||
errno
==
ECONNABORTED
||
errno
==
EPROTO
||
...
@@ -398,9 +402,9 @@ zmq::fd_t zmq::ipc_listener_t::accept ()
...
@@ -398,9 +402,9 @@ zmq::fd_t zmq::ipc_listener_t::accept ()
return
retired_fd
;
return
retired_fd
;
}
}
#if !defined ZMQ_HAVE_SOCK_CLOEXEC && defined FD_CLOEXEC
// Race condition can cause socket not to be closed (if fork happens
// Race condition can cause socket not to be closed (if fork happens
// between accept and this point).
// between accept and this point).
#ifdef FD_CLOEXEC
int
rc
=
fcntl
(
sock
,
F_SETFD
,
FD_CLOEXEC
);
int
rc
=
fcntl
(
sock
,
F_SETFD
,
FD_CLOEXEC
);
errno_assert
(
rc
!=
-
1
);
errno_assert
(
rc
!=
-
1
);
#endif
#endif
...
...
src/tcp_listener.cpp
View file @
61f9e71e
...
@@ -273,7 +273,11 @@ zmq::fd_t zmq::tcp_listener_t::accept ()
...
@@ -273,7 +273,11 @@ zmq::fd_t zmq::tcp_listener_t::accept ()
#else
#else
socklen_t
ss_len
=
sizeof
(
ss
);
socklen_t
ss_len
=
sizeof
(
ss
);
#endif
#endif
#if defined ZMQ_HAVE_SOCK_CLOEXEC
fd_t
sock
=
::
accept4
(
s
,
(
struct
sockaddr
*
)
&
ss
,
&
ss_len
,
SOCK_CLOEXEC
);
#else
fd_t
sock
=
::
accept
(
s
,
(
struct
sockaddr
*
)
&
ss
,
&
ss_len
);
fd_t
sock
=
::
accept
(
s
,
(
struct
sockaddr
*
)
&
ss
,
&
ss_len
);
#endif
#ifdef ZMQ_HAVE_WINDOWS
#ifdef ZMQ_HAVE_WINDOWS
if
(
sock
==
INVALID_SOCKET
)
{
if
(
sock
==
INVALID_SOCKET
)
{
...
@@ -299,9 +303,9 @@ zmq::fd_t zmq::tcp_listener_t::accept ()
...
@@ -299,9 +303,9 @@ zmq::fd_t zmq::tcp_listener_t::accept ()
}
}
#endif
#endif
#if !defined ZMQ_HAVE_SOCK_CLOEXEC && defined FD_CLOEXEC
// Race condition can cause socket not to be closed (if fork happens
// Race condition can cause socket not to be closed (if fork happens
// between accept and this point).
// between accept and this point).
#ifdef FD_CLOEXEC
int
rc
=
fcntl
(
sock
,
F_SETFD
,
FD_CLOEXEC
);
int
rc
=
fcntl
(
sock
,
F_SETFD
,
FD_CLOEXEC
);
errno_assert
(
rc
!=
-
1
);
errno_assert
(
rc
!=
-
1
);
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment