1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/socket/ancdata.c (discard_cmsg): workaround for MacOS X Lion.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2011-07-21 12:02:45 +00:00
parent 9752864b88
commit 272322bede
2 changed files with 14 additions and 2 deletions

View file

@ -1,3 +1,7 @@
Thu Jul 21 20:59:59 2011 Tanaka Akira <akr@fsij.org>
* ext/socket/ancdata.c (discard_cmsg): workaround for MacOS X Lion.
Thu Jul 21 20:02:11 2011 Yusuke Endoh <mame@tsg.ne.jp>
* thread.c (set_trace_func, thread_set_trace_func_m): reset tracing

View file

@ -1384,8 +1384,16 @@ discard_cmsg(struct cmsghdr *cmh, char *msg_end)
int *end = (int *)((char *)cmh + cmh->cmsg_len);
while ((char *)fdp + sizeof(int) <= (char *)end &&
(char *)fdp + sizeof(int) <= msg_end) {
/*
* xxx: nagachika said *fdp can be invalid fd on MacOS X Lion.
* This workaround using fstat is clearly wrong.
* we should investigate why *fdp contains invalid fd.
*/
struct stat buf;
if (fstat(*fdp, &buf) == 0) {
rb_update_max_fd(*fdp);
close(*fdp);
}
fdp++;
}
}