summaryrefslogtreecommitdiffstats
path: root/Modules/socketmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r--Modules/socketmodule.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 6f50fc3..82250ee 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -153,6 +153,18 @@ static object *SocketError;
static object *
socket_error()
{
+#ifdef NT
+ if (WSAGetLastError()) {
+ object *v;
+ v = mkvalue("(is)", WSAGetLastError(), "winsock error");
+ if (v != NULL) {
+ err_setval(SocketError, v);
+ DECREF(v);
+ }
+ return NULL;
+ }
+ else
+#endif
return err_errno(SocketError);
}