diff options
author | scottc <scottc> | 2002-09-17 15:38:47 +0000 |
---|---|---|
committer | scottc <scottc> | 2002-09-17 15:38:47 +0000 |
commit | dedf3e32636ad6e06d1e9d717aeb3732cba59424 (patch) | |
tree | 143708dd1567c6faec03632715b27254bb72691b | |
parent | feea7b7470fa87e3ec69145bad0555ec70231782 (diff) | |
download | gdb-dedf3e32636ad6e06d1e9d717aeb3732cba59424.tar.gz |
Merged changes from HEAD
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/thread.cc | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index a654b20ba87..29da76c813b 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 ff1f3e6a2a6..5dadfee7ee0 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 |