summaryrefslogtreecommitdiff
path: root/ext/socket/ancdata.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-23 23:57:50 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-23 23:57:50 +0000
commitf5b9de7502139b6c4013476e89b207fe39a5c104 (patch)
tree49501030af7e02c5e23cdcbff654c35135150be9 /ext/socket/ancdata.c
parent6b3ec75c7f31fbfa72d7fb17626744f40b2a6b73 (diff)
* ext/socket/extconf.rb: test recvmsg allocates file descriptors for
fd passing even with MSG_PEEK. * ext/socket/ancdata.c: use the above test result. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/ancdata.c')
-rw-r--r--ext/socket/ancdata.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c
index 4fc7a56..da837bf 100644
--- a/ext/socket/ancdata.c
+++ b/ext/socket/ancdata.c
@@ -1379,12 +1379,14 @@ rb_recvmsg(int fd, struct msghdr *msg, int flags)
static void
discard_cmsg(struct cmsghdr *cmh, char *msg_end, int msg_peek_p)
{
-# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
+# if !defined(FD_PASSING_WORK_WITH_RECVMSG_MSG_PEEK)
/*
- * nagachika finds recvmsg with MSG_PEEK doesn't return fds on MacOS X Snow Leopard. [ruby-dev:44209]
- * naruse finds FreeBSD behaves as so too and comment in kernel of FreeBSD 8.2.0. [ruby-dev:44189]
- * kosaki finds same comment in MacOS X Snow Leopard. [ruby-dev:44192]
- * Takahiro Kambe finds same comment since NetBSD 5. [ruby-dev:44205]
+ * FreeBSD 8.2.0, NetBSD 5 and MacOS X Snow Leopard doesn't
+ * allocate fds by recvmsg with MSG_PEEK.
+ * [ruby-dev:44189]
+ * http://redmine.ruby-lang.org/issues/5075
+ *
+ * Linux 2.6.38 allocate fds by recvmsg with MSG_PEEK.
*/
if (msg_peek_p)
return;