diff src/win32/libc_interface.c @ 12749:13276711babc

[gaim-migrate @ 15096] This allows us to access the errors, I might need to do something with the blocking for this. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Sat, 07 Jan 2006 06:30:27 +0000
parents 40fada5b3d59
children 33bef17125c2
line wrap: on
line diff
--- 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;