зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
42b4255d08
Коммит
1393e55d09
|
@ -1,4 +1,8 @@
|
|||
Wed Nov 9 22:54:30 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
Wed Nov 9 23:20:22 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* 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
|
||||
|
||||
* io.c (rb_sysopen): max fd is updated in rb_sysopen_internal()
|
||||
already.
|
||||
|
|
2
io.c
2
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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче