Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
61d32249
Commit
61d32249
authored
Jan 06, 2012
by
JINMEI Tatuya
Browse files
[805-merged] suggested changes: check non 0 result of send_fd in general;
close the function if send_fd fails.
parent
526b0b5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bin/sockcreator/sockcreator.cc
View file @
61d32249
...
...
@@ -131,7 +131,11 @@ run(const int input_fd, const int output_fd, const get_sock_t get_sock,
if
(
result
>=
0
)
{
// We got the socket
WRITE
(
"S"
,
1
);
// FIXME: Check the output and write a test for it
if
(
send_fd_fun
(
output_fd
,
result
)
==
FD_SYSTEM_ERROR
)
{
if
(
send_fd_fun
(
output_fd
,
result
)
!=
0
)
{
// We'll soon abort ourselves, but make sure we still
// close the socket; don't bother if it fails as the
// higher level result (abort) is the same.
close_fun
(
result
);
return
3
;
}
// Don't leak the socket
...
...
Write
Preview
Supports
Markdown
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