summaryrefslogtreecommitdiffstats
path: root/win32
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-28 09:14:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-28 09:14:14 +0000
commit63d35a5e551b2e0241edd015b2d1811e86c269f0 (patch)
tree788d839470218068033c99b7e3cd89f70e621104 /win32
parentdcf971ce75296c638a1fa759a5a9fd469d592e0d (diff)
downloadruby-63d35a5e551b2e0241edd015b2d1811e86c269f0.tar.gz
ruby-63d35a5e551b2e0241edd015b2d1811e86c269f0.tar.xz
ruby-63d35a5e551b2e0241edd015b2d1811e86c269f0.zip
* 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. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 942f01513..1d667cfa8 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -2432,6 +2432,7 @@ overlapped_socket_io(BOOL input, int fd, char *buf, int len, int flags,
int r;
int ret;
int mode;
+ st_data_t data;
DWORD flg;
WSAOVERLAPPED wol;
WSABUF wbuf;
@@ -2442,7 +2443,8 @@ overlapped_socket_io(BOOL input, int fd, char *buf, int len, int flags,
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 @@ fcntl(int fd, int cmd, ...)
int arg;
int ret;
int flag = 0;
+ st_data_t data;
u_long ioctlArg;
if (!is_socket(sock)) {
@@ -2934,7 +2937,8 @@ fcntl(int fd, int cmd, ...)
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 @@ truncate(const char *path, off_t length)
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 @@ rb_w32_close(int fd)
{
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) {