diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-02-07 11:47:06 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-02-07 11:47:06 +0000 |
commit | e9ff6d2717dce18093d60b3839463976bb523752 (patch) | |
tree | 1b03b6eb50d2bcd033f78a080d297c1a24ecffee /win32/perllib.c | |
parent | dd689578422c77934c796f47b23feb428d7fecd5 (diff) | |
download | perl-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.c | 10 |
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 |