[前][次][番号順一覧][スレッド一覧]

ruby-changes:22396

From: naruse <ko1@a...>
Date: Mon, 6 Feb 2012 21:27:00 +0900 (JST)
Subject: [ruby-changes:22396] naruse:r34445 (ruby_1_9_3): merge revision(s) 33691,33692:

naruse	2012-02-06 21:26:47 +0900 (Mon, 06 Feb 2012)

  New Revision: 34445

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34445

  Log:
    merge revision(s) 33691,33692:
    
    * 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
      EBADF.  [ruby-dev:44837] [Bug #5593].  Cf.

  Modified files:
    branches/ruby_1_9_3/io.c

Index: ruby_1_9_3/io.c
===================================================================
--- ruby_1_9_3/io.c	(revision 34444)
+++ ruby_1_9_3/io.c	(revision 34445)
@@ -155,7 +155,7 @@
 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;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]