summaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-23 15:38:06 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-23 15:38:06 +0000
commit85db5402bb15a3e3f560e6bebd22653a661f3805 (patch)
tree4fc53ebfdd5bbab438c0cbdc88b53e716c19f82b /io.c
parent242b124e77414f9574a46583dd691be051ab26eb (diff)
downloadruby-85db5402bb15a3e3f560e6bebd22653a661f3805.tar.gz
ruby-85db5402bb15a3e3f560e6bebd22653a661f3805.tar.xz
ruby-85db5402bb15a3e3f560e6bebd22653a661f3805.zip
* io.c (io_cntl): update max file descriptor by the result of
fcntl(F_DUPFD). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/io.c b/io.c
index 7ef11920e..426cba5a5 100644
--- a/io.c
+++ b/io.c
@@ -7237,6 +7237,9 @@ io_cntl(int fd, unsigned long cmd, long narg, int io_p)
# else
retval = io_p?ioctl(fd, cmd, narg):fcntl(fd, (int)cmd, narg);
# endif
+ if (!io_p && retval != -1 && cmd == F_DUPFD) {
+ UPDATE_MAXFD(retval);
+ }
#else
if (!io_p) {
rb_notimplement();