ruby-changes:6725
From: nobu <ko1@a...>
Date: Mon, 28 Jul 2008 18:14:30 +0900 (JST)
Subject: [ruby-changes:6725] Ruby:r18241 (trunk): * win32/win32.c (overlapped_socket_io, fcntl, rb_w32_close): must not
nobu 2008-07-28 18:14:14 +0900 (Mon, 28 Jul 2008) New Revision: 18241 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18241 Log: * win32/win32.c (overlapped_socket_io, fcntl, rb_w32_close): must not pass a pointer to int which is smaller than st_data_t on mswin64. Modified files: trunk/ChangeLog trunk/win32/win32.c Index: ChangeLog =================================================================== --- ChangeLog (revision 18240) +++ ChangeLog (revision 18241) @@ -1,3 +1,8 @@ +Mon Jul 28 18:14:03 2008 Nobuyoshi Nakada <nobu@r...> + + * win32/win32.c (overlapped_socket_io, fcntl, rb_w32_close): must not + pass a pointer to int which is smaller than st_data_t on mswin64. + Mon Jul 28 16:49:47 2008 Nobuyoshi Nakada <nobu@r...> * win32/win32.c (CreateChild, overlapped_socket_io): suppress Index: win32/win32.c =================================================================== --- win32/win32.c (revision 18240) +++ win32/win32.c (revision 18241) @@ -2432,6 +2432,7 @@ int r; int ret; int mode; + st_data_t data; DWORD flg; WSAOVERLAPPED wol; WSABUF wbuf; @@ -2442,7 +2443,8 @@ StartSockets(); s = TO_SOCKET(fd); - st_lookup(socklist, (st_data_t)s, (st_data_t *)&mode); + st_lookup(socklist, (st_data_t)s, &data); + mode = (int)data; if (!cancel_io || (mode & O_NONBLOCK)) { RUBY_CRITICAL({ if (input) { @@ -2920,6 +2922,7 @@ int arg; int ret; int flag = 0; + st_data_t data; u_long ioctlArg; if (!is_socket(sock)) { @@ -2934,7 +2937,8 @@ va_start(va, cmd); arg = va_arg(va, int); va_end(va); - st_lookup(socklist, (st_data_t)sock, (st_data_t*)&flag); + st_lookup(socklist, (st_data_t)sock, &data); + flag = (int)data; if (arg & O_NONBLOCK) { flag |= O_NONBLOCK; ioctlArg = 1; @@ -3584,7 +3588,7 @@ HANDLE h; int ret; if (IsWin95()) { - int fd = open(path, O_WRONLY), e; + int fd = open(path, O_WRONLY), e = 0; if (fd == -1) return -1; ret = chsize(fd, (unsigned long)length); if (ret == -1) e = errno; @@ -3986,13 +3990,16 @@ { SOCKET sock = TO_SOCKET(fd); int save_errno = errno; + st_data_t key; if (!is_socket(sock)) { UnlockFile((HANDLE)sock, 0, 0, LK_LEN, LK_LEN); return _close(fd); } _set_osfhnd(fd, (SOCKET)INVALID_HANDLE_VALUE); - st_delete(socklist, (st_data_t *)&sock, NULL); + key = (st_data_t)sock; + st_delete(socklist, &key, NULL); + sock = (SOCKET)key; _close(fd); errno = save_errno; if (closesocket(sock) == SOCKET_ERROR) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/