Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spdlog
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
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
Libraries
spdlog
Commits
e9d0b424
Unverified
Commit
e9d0b424
authored
Feb 10, 2020
by
Gabi Melman
Committed by
GitHub
Feb 10, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1427 from dominicpoeschko/patch-1
Handling SPDLOG_PREVENT_CHILD_FD in tcp_sink
parents
9f24f4bc
eef981e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
include/spdlog/sinks/tcp_sink.h
include/spdlog/sinks/tcp_sink.h
+7
-2
No files found.
include/spdlog/sinks/tcp_sink.h
View file @
e9d0b424
...
@@ -47,7 +47,7 @@ protected:
...
@@ -47,7 +47,7 @@ protected:
size_t
bytes_sent
=
0
;
size_t
bytes_sent
=
0
;
while
(
bytes_sent
<
formatted
.
size
())
while
(
bytes_sent
<
formatted
.
size
())
{
{
auto
write_result
=
::
write
(
sock_
,
formatted
.
data
(),
formatted
.
size
()
-
bytes_sent
);
auto
write_result
=
::
write
(
sock_
,
formatted
.
data
()
+
bytes_sent
,
formatted
.
size
()
-
bytes_sent
);
if
(
write_result
<
0
)
if
(
write_result
<
0
)
{
{
SPDLOG_THROW
(
spdlog
::
spdlog_ex
(
"write(2) failed"
,
errno
));
SPDLOG_THROW
(
spdlog
::
spdlog_ex
(
"write(2) failed"
,
errno
));
...
@@ -88,7 +88,12 @@ private:
...
@@ -88,7 +88,12 @@ private:
int
last_errno
=
0
;
int
last_errno
=
0
;
for
(
auto
*
rp
=
addrinfo_result
;
rp
!=
nullptr
;
rp
=
rp
->
ai_next
)
for
(
auto
*
rp
=
addrinfo_result
;
rp
!=
nullptr
;
rp
=
rp
->
ai_next
)
{
{
socket_rv
=
::
socket
(
rp
->
ai_family
,
rp
->
ai_socktype
,
rp
->
ai_protocol
);
#ifdef SPDLOG_PREVENT_CHILD_FD
int
const
flags
=
SOCK_CLOEXEC
;
#else
int
const
flags
=
0
;
#endif
socket_rv
=
::
socket
(
rp
->
ai_family
,
rp
->
ai_socktype
|
flags
,
rp
->
ai_protocol
);
if
(
socket_rv
==
-
1
)
if
(
socket_rv
==
-
1
)
{
{
last_errno
=
errno
;
last_errno
=
errno
;
...
...
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