aboutsummaryrefslogtreecommitdiff
path: root/slirp/udp.c
diff options
context:
space:
mode:
Diffstat (limited to 'slirp/udp.c')
-rw-r--r--slirp/udp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/slirp/udp.c b/slirp/udp.c
index 2dd51a39fe..aefa0b749b 100644
--- a/slirp/udp.c
+++ b/slirp/udp.c
@@ -339,7 +339,11 @@ udp_attach(so)
int lasterrno=errno;
closesocket(so->s);
so->s=-1;
+#ifdef _WIN32
+ WSASetLastError(lasterrno);
+#else
errno=lasterrno;
+#endif
} else {
/* success, insert in queue */
so->so_expire = curtime + SO_EXPIRE;