mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
3dcdb2c3b7
commit
8a78e0f6c0
1 changed files with 4 additions and 3 deletions
7
io.c
7
io.c
|
@ -197,16 +197,17 @@ rb_update_max_fd(int fd)
|
||||||
{
|
{
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
rb_atomic_t afd = (rb_atomic_t)fd;
|
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;
|
return;
|
||||||
|
|
||||||
if (fstat(fd, &buf) != 0 && errno == EBADF) {
|
if (fstat(fd, &buf) != 0 && errno == EBADF) {
|
||||||
rb_bug("rb_update_max_fd: invalid fd (%d) given.", fd);
|
rb_bug("rb_update_max_fd: invalid fd (%d) given.", fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (max_file_descriptor < afd) {
|
while (max_fd < afd) {
|
||||||
ATOMIC_CAS(max_file_descriptor, max_file_descriptor, afd);
|
max_fd = ATOMIC_CAS(max_file_descriptor, max_fd, afd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue