summaryrefslogtreecommitdiff
path: root/win32/perllib.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-02-07 11:47:06 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-02-07 11:47:06 +0000
commite9ff6d2717dce18093d60b3839463976bb523752 (patch)
tree1b03b6eb50d2bcd033f78a080d297c1a24ecffee /win32/perllib.c
parentdd689578422c77934c796f47b23feb428d7fecd5 (diff)
downloadperl-e9ff6d2717dce18093d60b3839463976bb523752.tar.gz
various Windows tweaks: make $^E a little less buggy by saving
and restoring system error across TLS fetch; avoid needless copying of buffers p4raw-id: //depot/perl@5024
Diffstat (limited to 'win32/perllib.c')
-rw-r--r--win32/perllib.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/win32/perllib.c b/win32/perllib.c
index 84a2a6dc4b..26135f864e 100644
--- a/win32/perllib.c
+++ b/win32/perllib.c
@@ -259,13 +259,19 @@ static DWORD g_TlsAllocIndex;
EXTERN_C DllExport bool
SetPerlInterpreter(void *interp)
{
- return TlsSetValue(g_TlsAllocIndex, interp);
+ DWORD dwErr = GetLastError();
+ bool bResult = TlsSetValue(g_TlsAllocIndex, interp);
+ SetLastError(dwErr);
+ return bResult;
}
EXTERN_C DllExport void*
GetPerlInterpreter(void)
{
- return TlsGetValue(g_TlsAllocIndex);
+ DWORD dwErr = GetLastError();
+ LPVOID pResult = TlsGetValue(g_TlsAllocIndex);
+ SetLastError(dwErr);
+ return pResult;
}
EXTERN_C DllExport int