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