summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-09 14:20:27 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-09 14:20:27 +0000
commit1393e55d094b05ce688a5d2477980cf941e685f4 (patch)
tree0b6b56d2aafce034387336cbea497bc986f18c0a /io.c
parent42b4255d087ec64ae2ed48d51dd6fe103ce397f6 (diff)
* io.c (rb_update_max_fd): fstat(2) can fail with other than
EBADF. [ruby-dev:44837] [Backport #4339]. Cf. http://pubs.opengroup.org/onlinepubs/9699919799/functions/fstat.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io.c b/io.c
index 0ffeb85942..bc661ce6d2 100644
--- a/io.c
+++ b/io.c
@@ -151,7 +151,7 @@ void
rb_update_max_fd(int fd)
{
struct stat buf;
- if (fstat(fd, &buf) != 0) {
+ if (fstat(fd, &buf) != 0 && errno == EBADF) {
rb_bug("rb_update_max_fd: invalid fd (%d) given.", fd);
}
if (max_file_descriptor < fd) max_file_descriptor = fd;