summaryrefslogtreecommitdiff
path: root/tsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'tsd.c')
-rw-r--r--tsd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tsd.c b/tsd.c
index 3cbebae..7b692b8 100644
--- a/tsd.c
+++ b/tsd.c
@@ -323,10 +323,12 @@ pthread_getspecific (pthread_key_t key)
*/
{
int lasterror = GetLastError();
+ int lastWSAerror = WSAGetLastError();
void *ptr = TlsGetValue (key->key);
SetLastError( lasterror );
+ WSASetLastError( lastWSAerror );
return ptr;
}