BIND 10 master, updated. c983a484207a8af30fbe90dcf2b2b4078ae8ff09 Merge branch 'work/fileexists'
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Feb 28 18:17:49 UTC 2012
The branch, master has been updated
via c983a484207a8af30fbe90dcf2b2b4078ae8ff09 (commit)
via 1c1308a191d8e151abb28acbb22db033764acb67 (commit)
via 16b39f3c2422a324963b67e136b07619209f869e (commit)
from 6ebbb5d27d5a52d5f5e5caf89d3514a5135f07c7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c983a484207a8af30fbe90dcf2b2b4078ae8ff09
Merge: 6ebbb5d27d5a52d5f5e5caf89d3514a5135f07c7 1c1308a191d8e151abb28acbb22db033764acb67
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Tue Feb 28 19:05:29 2012 +0100
Merge branch 'work/fileexists'
commit 1c1308a191d8e151abb28acbb22db033764acb67
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Tue Feb 28 19:05:10 2012 +0100
[1705] Don't leak the fd on close error
-----------------------------------------------------------------------
Summary of changes:
src/lib/util/io/fd_share.cc | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/util/io/fd_share.cc b/src/lib/util/io/fd_share.cc
index 82c629e..7adbbbe 100644
--- a/src/lib/util/io/fd_share.cc
+++ b/src/lib/util/io/fd_share.cc
@@ -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);
}
More information about the bind10-changes
mailing list