summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-01-06 21:28:54 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-01-06 21:28:54 +0000
commit199ef57934de0fd0bf2d1682df8714f85b65dfcc (patch)
treed35685e9c9e91e3254d9e6a26bde78d289e8d185 /eval.c
parent969519f1649c8dec38c6e3ea0fc63e7bd0d175fd (diff)
* eval.c (rb_fd_isset): compare the result of FD_ISSET with 0 to
avoid BSD bug. BSD defines FD_ISSET as just a bitmap of unsigned long. So returning the value from rb_fd_isset discards upper 32bits on LP64 environment. http://www.freebsd.org/cgi/query-pr.cgi?pr=ia64/91421 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 61f38e56f9..4705e06d25 100644
--- a/eval.c
+++ b/eval.c
@@ -9644,7 +9644,7 @@ rb_fd_isset(n, fds)
const rb_fdset_t *fds;
{
if (n >= fds->maxfd) return 0;
- return FD_ISSET(n, fds->fdset);
+ return FD_ISSET(n, fds->fdset) != 0; /* "!= 0" avoids BSD bug */
}
void