diff --git a/libunwind/src/UnwindCursor.hpp b/libunwind/src/UnwindCursor.hpp --- a/libunwind/src/UnwindCursor.hpp +++ b/libunwind/src/UnwindCursor.hpp @@ -2106,6 +2106,7 @@ // using dlopen(). const char libcxxabi[] = "libc++abi.a(libc++abi.so.1)"; void *libHandle; + int saveErrno = errno; libHandle = dlopen(libcxxabi, RTLD_MEMBER | RTLD_NOW); if (libHandle == NULL) { _LIBUNWIND_TRACE_UNWINDING("dlopen() failed with errno=%d\n", @@ -2119,6 +2120,7 @@ assert(0 && "dlsym() failed"); } dlclose(libHandle); + errno = saveErrno; } } xlcPersonalityV0InitLock.unlock();