ruby-changes:9501
From: yugui <ko1@a...>
Date: Thu, 25 Dec 2008 19:14:44 +0900 (JST)
Subject: [ruby-changes:9501] Ruby:r21041 (ruby_1_9_1): merges r20990 from trunk into ruby_1_9_1.
yugui 2008-12-25 18:58:18 +0900 (Thu, 25 Dec 2008) New Revision: 21041 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21041 Log: merges r20990 from trunk into ruby_1_9_1. * io.c (rb_io_initialize): check fd validity. [ruby-dev:36646] Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/io.c Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 21040) +++ ruby_1_9_1/ChangeLog (revision 21041) @@ -1,3 +1,7 @@ +Thu Dec 25 17:06:13 2008 Tanaka Akira <akr@f...> + + * io.c (rb_io_initialize): check fd validity. [ruby-dev:36646] + Thu Dec 25 16:23:31 2008 Tanaka Akira <akr@f...> * io.c (flush_before_seek): check io_fflush result. Index: ruby_1_9_1/io.c =================================================================== --- ruby_1_9_1/io.c (revision 21040) +++ ruby_1_9_1/io.c (revision 21041) @@ -5898,6 +5898,7 @@ int fd, fmode, oflags = O_RDONLY; convconfig_t convconfig; VALUE opt; + struct stat st; rb_secure(4); @@ -5906,6 +5907,7 @@ rb_io_extract_modeenc(&vmode, 0, opt, &oflags, &fmode, &convconfig); fd = NUM2INT(fnum); + if (fstat(fd, &st) == -1) rb_sys_fail(0); UPDATE_MAXFD(fd); if (NIL_P(vmode)) { #if defined(HAVE_FCNTL) && defined(F_GETFL) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/