summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrpj <rpj>2001-08-23 05:43:54 +0000
committerrpj <rpj>2001-08-23 05:43:54 +0000
commit072136baeb545093ef776983512c6adc2107dd3f (patch)
tree2c292524b364e166bc0ef4a33e99504d1c0b8d8d
parent5be65c802888b2e6f42b3256053b67e2d755d842 (diff)
* tsd.c (pthread_getspecific): Preserve the last
winsock error [from WSAGetLastError()].
-rw-r--r--ChangeLog7
-rw-r--r--tsd.c2
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index be2c81b..5a5bbdd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2001-08-23 Ross Johnson <rpj@setup1.ise.canberra.edu.au>
+
+ Contributed by - "Phil Frisbie, Jr." <phil@hawksoft.com>
+
+ * tsd.c (pthread_getspecific): Preserve the last
+ winsock error [from WSAGetLastError()].
+
2001-07-18 Ross Johnson <rpj@setup1.ise.canberra.edu.au>
Contributed by - "Scott McCaskill" <scott@magruder.org>
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;
}