# HG changeset patch # User Daniel Atallah # Date 1181331091 0 # Node ID e60f5e8bb77e7f9a4c95e9c33f6dd1da2673f3d4 # Parent 6e4e2d234c3a88431397320af97c841b9c0ebe05 Pretend that WSAEINPROGRESS is EAGAIN (for our purposes, I think they are equivalent). I think this might help #485. References #485. diff -r 6e4e2d234c3a -r e60f5e8bb77e libpurple/win32/libc_interface.c --- a/libpurple/win32/libc_interface.c Fri Jun 08 18:24:23 2007 +0000 +++ b/libpurple/win32/libc_interface.c Fri Jun 08 19:31:31 2007 +0000 @@ -1,6 +1,6 @@ /* * purple - * + * * Copyright (C) 2002-2003, Herman Bloggs * * This program is free software; you can redistribute it and/or modify @@ -74,7 +74,7 @@ int ret; ret = connect( socket, addr, length ); - + if( ret == SOCKET_ERROR ) { errno = WSAGetLastError(); if( errno == WSAEWOULDBLOCK ) @@ -129,6 +129,8 @@ if ((ret = sendto(socket, buf, len, flags, to, tolen) ) == SOCKET_ERROR) { errno = WSAGetLastError(); + if(errno == WSAEWOULDBLOCK || errno == WSAEINPROGRESS) + errno = EAGAIN; return -1; } return ret; @@ -302,7 +304,7 @@ if(wpurple_is_socket(fd)) { if((ret = recv(fd, buf, size, 0)) == SOCKET_ERROR) { errno = WSAGetLastError(); - if(errno == WSAEWOULDBLOCK) + if(errno == WSAEWOULDBLOCK || errno == WSAEINPROGRESS) errno = EAGAIN; return -1; } @@ -330,7 +332,7 @@ if (ret == SOCKET_ERROR) { errno = WSAGetLastError(); - if(errno == WSAEWOULDBLOCK) + if(errno == WSAEWOULDBLOCK || errno == WSAEINPROGRESS) errno = EAGAIN; return -1; } @@ -350,7 +352,7 @@ if((ret = recv(fd, buf, len, flags)) == SOCKET_ERROR) { errno = WSAGetLastError(); - if(errno == WSAEWOULDBLOCK) + if(errno == WSAEWOULDBLOCK || errno == WSAEINPROGRESS) errno = EAGAIN; return -1; } else { @@ -392,7 +394,7 @@ z->tz_minuteswest = _timezone/60; z->tz_dsttime = _daylight; } - + if (p != 0) { _ftime(&timebuffer); p->tv_sec = timebuffer.time; /* seconds since 1-1-1970 */ @@ -1044,7 +1046,7 @@ * Returns: zero if the pathname refers to an existing file system * object that has all the tested permissions, or -1 otherwise or on * error. - * + * * Since: 2.8 */ int @@ -1056,7 +1058,7 @@ wchar_t *wfilename = g_utf8_to_utf16 (filename, -1, NULL, NULL, NULL); int retval; int save_errno; - + if (wfilename == NULL) { errno = EINVAL; @@ -1072,7 +1074,7 @@ return retval; } else - { + { gchar *cp_filename = g_locale_from_utf8 (filename, -1, NULL, NULL, NULL); int retval; int save_errno;