Commit 389ceb4a authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[master] Merge branch 'master' of ssh://git.bind10.isc.org/var/bind10/git/bind10

parents d18c0498 8f5187d1
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment