From 843acddbe167ff9d47a71b27eb4264c0d88b6cae Mon Sep 17 00:00:00 2001 From: akr Date: Fri, 23 Oct 2009 15:38:06 +0000 Subject: * io.c (io_cntl): update max file descriptor by the result of fcntl(F_DUPFD). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'io.c') diff --git a/io.c b/io.c index 7ef11920ed..426cba5a55 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(); -- cgit v1.2.3