summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/error.c')
-rw-r--r--lib/libalpm/error.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libalpm/error.c b/lib/libalpm/error.c
index b87c3f2e..38e087bf 100644
--- a/lib/libalpm/error.c
+++ b/lib/libalpm/error.c
@@ -29,7 +29,12 @@
alpm_errno_t SYMEXPORT alpm_errno(alpm_handle_t *handle)
{
+#ifdef HAVE_PTHREAD
+ int *err = pthread_getspecific(handle->tkey_err);
+ return err ? *err : 0;
+#else
return handle->pm_errno;
+#endif
}
const char SYMEXPORT *alpm_strerror(alpm_errno_t err)