aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-19 08:36:02 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-19 08:36:02 +0000
commitc1f1131a57e1b13d93a10896ae944656214772bc (patch)
treeebc3afee62a478d8f89d28eb45613c258ceb9ec5 /io.c
parent856b2c324a67e462c79b7beb31299d7c256a1ad9 (diff)
downloadruby-c1f1131a57e1b13d93a10896ae944656214772bc.tar.gz
io.c: suppress warning
* io.c (rb_update_max_fd): get rid of unused-value warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/io.c b/io.c
index cacff40851..03764b0e78 100644
--- a/io.c
+++ b/io.c
@@ -197,16 +197,17 @@ rb_update_max_fd(int fd)
{
struct stat buf;
rb_atomic_t afd = (rb_atomic_t)fd;
+ rb_atomic_t max_fd = max_file_descriptor;
- if (afd <= max_file_descriptor)
+ if (afd <= max_fd)
return;
if (fstat(fd, &buf) != 0 && errno == EBADF) {
rb_bug("rb_update_max_fd: invalid fd (%d) given.", fd);
}
- while (max_file_descriptor < afd) {
- ATOMIC_CAS(max_file_descriptor, max_file_descriptor, afd);
+ while (max_fd < afd) {
+ max_fd = ATOMIC_CAS(max_file_descriptor, max_fd, afd);
}
}