summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-22 07:13:40 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-22 07:13:40 +0000
commit6e4d210f409f8922a1064998bb7e8e28c9b7607d (patch)
treecfed2fba136cccd8cf599de53a3b34f0972d909b
parent095868b1c87f6037bc1ced0e39e764013ec95dfe (diff)
downloadruby-6e4d210f409f8922a1064998bb7e8e28c9b7607d.tar.gz
ruby-6e4d210f409f8922a1064998bb7e8e28c9b7607d.tar.xz
ruby-6e4d210f409f8922a1064998bb7e8e28c9b7607d.zip
* revert previous revision. it's already out-of-date.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--include/ruby/win32.h1
-rw-r--r--io.c6
-rw-r--r--win32/win32.c9
4 files changed, 6 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 46cbabc60..511bda6a1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Jan 22 16:12:51 2009 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * revert previous revision. it's already out-of-date.
+
Thu Jan 22 15:54:02 2009 NAKAMURA Usaku <usa@ruby-lang.org>
* include/ruby/win32.h, win32/win32.c (rb_w32_is_valid_fd): new function
diff --git a/include/ruby/win32.h b/include/ruby/win32.h
index 1bbe69e69..46388a3ae 100644
--- a/include/ruby/win32.h
+++ b/include/ruby/win32.h
@@ -214,7 +214,6 @@ extern int WSAAPI rb_w32_connect(int, const struct sockaddr *, int);
extern void rb_w32_fdset(int, fd_set*);
extern void rb_w32_fdclr(int, fd_set*);
extern int rb_w32_fdisset(int, fd_set*);
-extern int rb_w32_is_valid_fd(int);
extern int WSAAPI rb_w32_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
extern int WSAAPI rb_w32_getpeername(int, struct sockaddr *, int *);
extern int WSAAPI rb_w32_getsockname(int, struct sockaddr *, int *);
diff --git a/io.c b/io.c
index c62af6ee3..5555de7c2 100644
--- a/io.c
+++ b/io.c
@@ -5971,15 +5971,13 @@ rb_io_initialize(int argc, VALUE *argv, VALUE io)
fd = NUM2INT(fnum);
if (fstat(fd, &st) == -1) rb_sys_fail(0);
UPDATE_MAXFD(fd);
-#if defined(HAVE_FCNTL) && defined(F_GETFL)
if (NIL_P(vmode)) {
+#if defined(HAVE_FCNTL) && defined(F_GETFL)
oflags = fcntl(fd, F_GETFL);
if (oflags == -1) rb_sys_fail(0);
fmode = rb_io_oflags_fmode(oflags);
- }
-#elif defined(_WIN32)
- if (rb_w32_is_valid_fd(fd)) rb_sys_fail(0);
#endif
+ }
MakeOpenFile(io, fp);
fp->fd = fd;
fp->mode = fmode;
diff --git a/win32/win32.c b/win32/win32.c
index ba8a96e82..b948fe0d7 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -1836,15 +1836,6 @@ rb_w32_open_osfhandle(intptr_t osfhandle, int flags)
}
#endif
-int
-rb_w32_is_valid_fd(int fd)
-{
- if (_get_osfhandle(fd) == -1)
- return -1;
- else
- return 0;
-}
-
#undef getsockopt
static int