# HG changeset patch # User Daniel Atallah # Date 1136615427 0 # Node ID 13276711babcc1538bdb1559b0da2687685d5798 # Parent dd271caf25b0df3c418a2ffb0d06ca2e15c5912c [gaim-migrate @ 15096] This allows us to access the errors, I might need to do something with the blocking for this. committer: Tailor Script diff -r dd271caf25b0 -r 13276711babc src/win32/libc_interface.c --- a/src/win32/libc_interface.c Sat Jan 07 03:56:15 2006 +0000 +++ b/src/win32/libc_interface.c Sat Jan 07 06:30:27 2006 +0000 @@ -311,12 +311,22 @@ /* success */ return ret; } - } else return write(fd, buf, size); } +int wgaim_recv(int fd, void *buf, size_t len, int flags) { + int ret; + + if ((ret = recv(fd, buf, len, flags)) == SOCKET_ERROR) { + errno = WSAGetLastError(); + return -1; + } else { + return ret; + } +} + int wgaim_close(int fd) { int ret; diff -r dd271caf25b0 -r 13276711babc src/win32/libc_interface.h --- a/src/win32/libc_interface.h Sat Jan 07 03:56:15 2006 +0000 +++ b/src/win32/libc_interface.h Sat Jan 07 06:30:27 2006 +0000 @@ -108,6 +108,10 @@ #define write( socket, buf, buflen ) \ wgaim_write( socket, buf, buflen ) +int wgaim_recv(int fd, void *buf, size_t len, int flags); +#define recv(fd, buf, len, flags) \ +wgaim_recv(fd, buf, len, flags) + int wgaim_close(int fd); #define close( fd ) \ wgaim_close( fd )