From 9f06b64aa97983deb44f4901e74b8974703ec6c6 Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Tue, 17 Sep 2002 10:01:49 +0000 Subject: 2002-09-17 Robert Collins * thread.cc (pthread_key::set): Preserve GetLastError(). Reported by Thomas Pffaf. --- winsup/cygwin/thread.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'winsup/cygwin/thread.cc') 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 -- cgit v1.2.3