1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
usa 2012-06-06 04:18:53 +00:00
parent 494d01410f
commit 4c3e402cda
2 changed files with 13 additions and 1 deletions

View file

@ -1,3 +1,7 @@
Wed Jun 6 13:18:26 2012 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (rb_w32_close): of course, console handle is not socket.
Wed Jun 6 12:37:43 2012 NAKAMURA Usaku <usa@ruby-lang.org>
* process.c (rb_run_exec_options_err): allocate a temporary buffer for

View file

@ -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)
{