Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
9cf50296
Commit
9cf50296
authored
Oct 18, 2018
by
Jon Siwek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add explicit close-on-exec check for sockets
To cover cases where SOCK_CLOEXEC is not defined or not implemented.
parent
c7114f5c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
libcaf_io/src/default_multiplexer.cpp
libcaf_io/src/default_multiplexer.cpp
+2
-0
No files found.
libcaf_io/src/default_multiplexer.cpp
View file @
9cf50296
...
@@ -782,6 +782,7 @@ new_tcp_connection(const std::string& host, uint16_t port,
...
@@ -782,6 +782,7 @@ new_tcp_connection(const std::string& host, uint16_t port,
#endif
#endif
CALL_CFUN
(
fd
,
detail
::
cc_valid_socket
,
"socket"
,
CALL_CFUN
(
fd
,
detail
::
cc_valid_socket
,
"socket"
,
socket
(
proto
==
ipv4
?
AF_INET
:
AF_INET6
,
socktype
,
0
));
socket
(
proto
==
ipv4
?
AF_INET
:
AF_INET6
,
socktype
,
0
));
child_process_inherit
(
fd
,
false
);
detail
::
socket_guard
sguard
(
fd
);
detail
::
socket_guard
sguard
(
fd
);
if
(
proto
==
ipv6
)
{
if
(
proto
==
ipv6
)
{
if
(
ip_connect
<
AF_INET6
>
(
fd
,
res
->
first
,
port
))
{
if
(
ip_connect
<
AF_INET6
>
(
fd
,
res
->
first
,
port
))
{
...
@@ -837,6 +838,7 @@ expected<native_socket> new_ip_acceptor_impl(uint16_t port, const char* addr,
...
@@ -837,6 +838,7 @@ expected<native_socket> new_ip_acceptor_impl(uint16_t port, const char* addr,
socktype
|=
SOCK_CLOEXEC
;
socktype
|=
SOCK_CLOEXEC
;
#endif
#endif
CALL_CFUN
(
fd
,
detail
::
cc_valid_socket
,
"socket"
,
socket
(
Family
,
socktype
,
0
));
CALL_CFUN
(
fd
,
detail
::
cc_valid_socket
,
"socket"
,
socket
(
Family
,
socktype
,
0
));
child_process_inherit
(
fd
,
false
);
// sguard closes the socket in case of exception
// sguard closes the socket in case of exception
detail
::
socket_guard
sguard
{
fd
};
detail
::
socket_guard
sguard
{
fd
};
if
(
reuse_addr
)
{
if
(
reuse_addr
)
{
...
...
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