]> sourceware.org Git - newlib-cygwin.git/commitdiff
2002-09-17 Robert Collins <rbtcollins@hotmail.com>
authorRobert Collins <rbtcollins@hotmail.com>
Tue, 17 Sep 2002 10:01:49 +0000 (10:01 +0000)
committerRobert Collins <rbtcollins@hotmail.com>
Tue, 17 Sep 2002 10:01:49 +0000 (10:01 +0000)
        * thread.cc (pthread_key::set): Preserve GetLastError(). Reported
        by Thomas Pffaf.

winsup/cygwin/ChangeLog
winsup/cygwin/thread.cc

index 4d9988c7df159c864870017052f85c033a967e15..a856a2ee0b3b371016abdd099edf1b9b75332fcc 100644 (file)
@@ -1,3 +1,8 @@
+2002-09-17  Robert Collins <rbtcollins@hotmail.com>
+
+       * thread.cc (pthread_key::set): Preserve GetLastError(). Reported
+       by Thomas Pffaf.
+
 2002-09-17  Robert Collins  <rbtcollins@hotmail.com>
 
        This work inspires by Thomas Pfaff's pthread_fork patch (1).
index ff1f3e6a2a64b65faf47bacc2369706e666de544..5dadfee7ee0a40534cf1f7677a6bc271d625074a 100644 (file)
@@ -1101,8 +1101,10 @@ pthread_key::set (const void *value)
 void *
 pthread_key::get ()
 {
-  set_errno (0);
-  return TlsGetValue (dwTlsIndex);
+  int savedError = ::GetLastError();
+  void *result = TlsGetValue (dwTlsIndex);
+  ::SetLastError (savedError);
+  return result;
 }
 
 void
This page took 0.03938 seconds and 5 git commands to generate.