BIND 10 master, updated. 8f5187d167219ac263ef940eb33923ef8a86e87b Merge #1705

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Feb 24 12:14:42 UTC 2012


The branch, master has been updated
       via  8f5187d167219ac263ef940eb33923ef8a86e87b (commit)
       via  6ca1f0da6b1e7dc488e5ff57b9ef041f4322ab67 (commit)
      from  464cada643779ceff4b3886aa5ccfec6605e2e92 (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 8f5187d167219ac263ef940eb33923ef8a86e87b
Merge: 464cada643779ceff4b3886aa5ccfec6605e2e92 6ca1f0da6b1e7dc488e5ff57b9ef041f4322ab67
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Fri Feb 24 13:06:30 2012 +0100

    Merge #1705

-----------------------------------------------------------------------

Summary of changes:
 src/lib/util/io/fd_share.cc |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/util/io/fd_share.cc b/src/lib/util/io/fd_share.cc
index 9c02a33..82c629e 100644
--- a/src/lib/util/io/fd_share.cc
+++ b/src/lib/util/io/fd_share.cc
@@ -20,6 +20,7 @@
 #include <sys/uio.h>
 #include <errno.h>
 #include <stdlib.h>             // for malloc and free
+#include <unistd.h>
 #include "fd_share.h"
 
 namespace isc {
@@ -106,7 +107,12 @@ recv_fd(const int sock) {
         std::memcpy(&fd, CMSG_DATA(cmsg), sizeof(int));
     }
     free(msghdr.msg_control);
-    return (fd);
+    // It is strange, but the call can return the same file descriptor as
+    // 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);
+    return (new_fd);
 }
 
 int



More information about the bind10-changes mailing list