aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-26 12:27:04 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-26 12:27:04 +0000
commitb4312303967924bda5e280e189dbbcf3538ec1dd (patch)
tree3151a7f46d7a62433cffd8ffdc7b3c1f4d0f1809
parentc83e7dfab210b2be7fa5f18621d0d1c6de54fc48 (diff)
downloadruby-b4312303967924bda5e280e189dbbcf3538ec1dd.tar.gz
* io.c (rb_fdopen): set errno if it's zero on win32 platforms.
* ext/openssl/ossl_ssl.c (TO_SOCKET): define special version when _WIN32 is defined. this is ruby's problem, not OpenSSL. * win32/win32.c: remove some old comments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog9
-rw-r--r--ext/openssl/ossl_ssl.c2
-rw-r--r--io.c3
-rw-r--r--win32/win32.c16
4 files changed, 13 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 34933ef55e..506263be4f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Sat Jul 26 21:25:21 2003 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * io.c (rb_fdopen): set errno if it's zero on win32 platforms.
+
+ * ext/openssl/ossl_ssl.c (TO_SOCKET): define special version when
+ _WIN32 is defined. this is ruby's problem, not OpenSSL.
+
+ * win32/win32.c: remove some old comments.
+
Sat Jul 26 14:14:12 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* ext/stringio/stringio.c: includes Enumerable as well as IO.
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index 387b71c3b1..282d512fe0 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -19,7 +19,7 @@
#define numberof(ary) (sizeof(ary)/sizeof(ary[0]))
-#ifdef OPENSSL_SYS_WINDOWS
+#ifdef _WIN32
# define TO_SOCKET(s) _get_osfhandle(s)
#else
# define TO_SOCKET(s) s
diff --git a/io.c b/io.c
index 681ba97ec3..debb94a7cd 100644
--- a/io.c
+++ b/io.c
@@ -1859,6 +1859,9 @@ rb_fdopen(fd, mode)
file = fdopen(fd, mode);
}
if (!file) {
+#ifdef _WIN32
+ if (errno == 0) errno = EINVAL;
+#endif
rb_sys_fail(0);
}
}
diff --git a/win32/win32.c b/win32/win32.c
index e36c0d1cb7..f334e2f746 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -351,9 +351,6 @@ flock(int fd, int oper)
(DWORD)-1);
}
-//#undef const
-//FILE *fdopen(int, const char *);
-
//
// Initialization stuff
//
@@ -1486,19 +1483,6 @@ valid_filename(char *s)
return 0;
}
-//
-// This is a clone of fdopen so that we can handle the
-// brain damaged version of sockets that NT gets to use.
-//
-// The problem is that sockets are not real file handles and
-// cannot be fdopen'ed. This causes problems in the do_socket
-// routine in doio.c, since it tries to create two file pointers
-// for the socket just created. We'll fake out an fdopen and see
-// if we can prevent perl from trying to do stdio on sockets.
-//
-
-//EXTERN_C int __cdecl _alloc_osfhnd(void);
-//EXTERN_C int __cdecl _set_osfhnd(int fh, long value);
EXTERN_C void __cdecl _lock_fhandle(int);
EXTERN_C void __cdecl _unlock_fhandle(int);
EXTERN_C void __cdecl _unlock(int);