summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-05-22 17:01:04 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-05-22 17:01:04 +0000
commit9ce7c81abb4683595c709c17a34bf1809191e91f (patch)
treee266b2861adee86f9ef89a298a66f069c4911372
parenta8726c04b1d6870a2a584acf7299b5d64e62a185 (diff)
merge -r 12165:12168
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@12318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--version.h2
-rw-r--r--win32/win32.c4
3 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 321ce53b8a..ba518c33e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed May 23 01:55:49 2007 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_fclose, rb_w32_close): need to save errno
+ before calling original fclose()/close().
+
Wed May 23 01:42:29 2007 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/imap.rb (disconnect): call shutdown for
diff --git a/version.h b/version.h
index 058a24569f..6c581ec1a6 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2007-05-23"
#define RUBY_VERSION_CODE 185
#define RUBY_RELEASE_CODE 20070523
-#define RUBY_PATCHLEVEL 42
+#define RUBY_PATCHLEVEL 43
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8
diff --git a/win32/win32.c b/win32/win32.c
index d63e3ab172..1ca2ee41ed 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -3613,6 +3613,7 @@ rb_w32_fclose(FILE *fp)
{
int fd = fileno(fp);
SOCKET sock = TO_SOCKET(fd);
+ int save_errno = errno;
if (fflush(fp)) return -1;
if (!is_socket(sock)) {
@@ -3621,6 +3622,7 @@ rb_w32_fclose(FILE *fp)
}
_set_osfhnd(fd, (SOCKET)INVALID_HANDLE_VALUE);
fclose(fp);
+ errno = save_errno;
if (closesocket(sock) == SOCKET_ERROR) {
errno = map_errno(WSAGetLastError());
return -1;
@@ -3632,6 +3634,7 @@ int
rb_w32_close(int fd)
{
SOCKET sock = TO_SOCKET(fd);
+ int save_errno = errno;
if (!is_socket(sock)) {
UnlockFile((HANDLE)sock, 0, 0, LK_LEN, LK_LEN);
@@ -3639,6 +3642,7 @@ rb_w32_close(int fd)
}
_set_osfhnd(fd, (SOCKET)INVALID_HANDLE_VALUE);
_close(fd);
+ errno = save_errno;
if (closesocket(sock) == SOCKET_ERROR) {
errno = map_errno(WSAGetLastError());
return -1;