Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Adam Osuchowski
Kea
Commits
c983a484
Commit
c983a484
authored
Feb 28, 2012
by
Michal 'vorner' Vaner
Browse files
Merge branch 'work/fileexists'
parents
6ebbb5d2
1c1308a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/util/io/fd_share.cc
View file @
c983a484
...
...
@@ -111,7 +111,16 @@ recv_fd(const int sock) {
// one returned previously, even if that one is not closed yet. So,
// we just re-number every one we get, so they are unique.
int
new_fd
(
dup
(
fd
));
close
(
fd
);
int
close_error
(
close
(
fd
));
if
(
close_error
==
-
1
||
new_fd
==
-
1
)
{
// We need to return an error, because something failed. But in case
// it was the previous close, we at least try to close the duped FD.
if
(
new_fd
!=
-
1
)
{
close
(
new_fd
);
// If this fails, nothing but returning error can't
// be done and we are doing that anyway.
}
return
(
FD_SYSTEM_ERROR
);
}
return
(
new_fd
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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