From ee0f08bd998fe843b2a8148648ed87a41da12b7d Mon Sep 17 00:00:00 2001 From: shyouhei Date: Tue, 22 May 2007 17:00:29 +0000 Subject: merge -r 12165:12168 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@12317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ version.h | 2 +- win32/win32.c | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7e823e2370..99cd396db4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed May 23 01:55:49 2007 NAKAMURA Usaku + + * 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 * lib/net/imap.rb (disconnect): call shutdown for diff --git a/version.h b/version.h index bc0e2dfa96..9122364e5d 100644 --- a/version.h +++ b/version.h @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2007-05-23" #define RUBY_VERSION_CODE 186 #define RUBY_RELEASE_CODE 20070523 -#define RUBY_PATCHLEVEL 11 +#define RUBY_PATCHLEVEL 12 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 diff --git a/win32/win32.c b/win32/win32.c index f82a2f4494..cd344eac94 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -3634,6 +3634,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)) { @@ -3642,6 +3643,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; @@ -3653,6 +3655,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); @@ -3660,6 +3663,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; -- cgit v1.2.3