From 4c3e402cda1347ebfd94d6070c28ec159f2767d9 Mon Sep 17 00:00:00 2001 From: usa Date: Wed, 6 Jun 2012 04:18:53 +0000 Subject: * win32/win32.c (rb_w32_close): of course, console handle is not socket. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ win32/win32.c | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f86e2e88c4..7a1e0f2f6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Wed Jun 6 13:18:26 2012 NAKAMURA Usaku + + * win32/win32.c (rb_w32_close): of course, console handle is not socket. + Wed Jun 6 12:37:43 2012 NAKAMURA Usaku * process.c (rb_run_exec_options_err): allocate a temporary buffer for diff --git a/win32/win32.c b/win32/win32.c index e5be0d94af..8633c8600e 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -3062,6 +3062,8 @@ rb_w32_getsockname(int s, struct sockaddr *addr, int *addrlen) return r; } +#undef getsockopt + /* License: Artistic or GPL */ int WSAAPI rb_w32_getsockopt(int s, int level, int optname, char *optval, int *optlen) @@ -5902,11 +5904,11 @@ rb_w32_close(int fd) if (!is_socket(sock)) { UnlockFile((HANDLE)sock, 0, 0, LK_LEN, LK_LEN); + constat_delete((HANDLE)sock); return _close(fd); } _set_osfhnd(fd, (SOCKET)INVALID_HANDLE_VALUE); socklist_delete(&sock, NULL); - constat_delete((HANDLE)sock); _close(fd); errno = save_errno; if (closesocket(sock) == SOCKET_ERROR) { @@ -6630,12 +6632,14 @@ rb_w32_inet_ntop(int af, const void *addr, char *numaddr, size_t numaddr_len) return numaddr; } +/* License: Ruby's */ char rb_w32_fd_is_text(int fd) { return _osfile(fd) & FTEXT; } #if RUBY_MSVCRT_VERSION < 80 +/* License: Ruby's */ static int unixtime_to_systemtime(const time_t t, SYSTEMTIME *st) { @@ -6645,6 +6649,7 @@ unixtime_to_systemtime(const time_t t, SYSTEMTIME *st) return 0; } +/* License: Ruby's */ static void systemtime_to_tm(const SYSTEMTIME *st, struct tm *t) { @@ -6670,6 +6675,7 @@ systemtime_to_tm(const SYSTEMTIME *st, struct tm *t) t->tm_yday = d - 1; } +/* License: Ruby's */ static int systemtime_to_localtime(TIME_ZONE_INFORMATION *tz, SYSTEMTIME *gst, SYSTEMTIME *lst) { @@ -6694,6 +6700,7 @@ systemtime_to_localtime(TIME_ZONE_INFORMATION *tz, SYSTEMTIME *gst, SYSTEMTIME * } #endif +/* License: Ruby's */ struct tm * gmtime_r(const time_t *tp, struct tm *rp) { @@ -6717,6 +6724,7 @@ gmtime_r(const time_t *tp, struct tm *rp) return rp; } +/* License: Ruby's */ struct tm * localtime_r(const time_t *tp, struct tm *rp) { -- cgit v1.2.3