Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Collins <rbtcollins@hotmail.com>2002-09-17 14:01:49 +0400
committerRobert Collins <rbtcollins@hotmail.com>2002-09-17 14:01:49 +0400
commit9f06b64aa97983deb44f4901e74b8974703ec6c6 (patch)
tree34b1c2dab774efa7145286faa1245cf25a97bc3e
parentf1f1379560fafd4608b35c2ea6264cee5fdc1adf (diff)
2002-09-17 Robert Collins <rbtcollins@hotmail.com>
* thread.cc (pthread_key::set): Preserve GetLastError(). Reported by Thomas Pffaf.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/thread.cc6
2 files changed, 9 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 4d9988c7d..a856a2ee0 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -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).
diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc
index ff1f3e6a2..5dadfee7e 100644
--- a/winsup/cygwin/thread.cc
+++ b/winsup/cygwin/thread.cc
@@ -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