summaryrefslogtreecommitdiff
path: root/lib/libalpm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/alpm.h1
-rw-r--r--lib/libalpm/error.c5
-rw-r--r--lib/libalpm/error.h2
3 files changed, 7 insertions, 1 deletions
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index 75c30987..1506e3d5 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -461,6 +461,7 @@ enum _pmerrno_t {
extern enum _pmerrno_t pm_errno;
const char *alpm_strerror(int err);
+const char *alpm_strerrorlast(void);
#ifdef __cplusplus
}
diff --git a/lib/libalpm/error.c b/lib/libalpm/error.c
index b5e301aa..f81d22da 100644
--- a/lib/libalpm/error.c
+++ b/lib/libalpm/error.c
@@ -30,6 +30,11 @@
#include "alpm.h"
/* TODO does this really need a file all on its own? */
+const char SYMEXPORT *alpm_strerrorlast(void)
+{
+ return alpm_strerror(pm_errno);
+}
+
const char SYMEXPORT *alpm_strerror(int err)
{
switch(err) {
diff --git a/lib/libalpm/error.h b/lib/libalpm/error.h
index e21a5f60..8e9e7c80 100644
--- a/lib/libalpm/error.h
+++ b/lib/libalpm/error.h
@@ -22,7 +22,7 @@
#define _ALPM_ERROR_H
#define RET_ERR(err, ret) do { pm_errno = (err); \
- _alpm_log(PM_LOG_DEBUG, "returning error %d from %s : %s\n", err, __func__, alpm_strerror(err)); \
+ _alpm_log(PM_LOG_DEBUG, "returning error %d from %s : %s\n", err, __func__, alpm_strerrorlast()); \
return(ret); } while(0)
#endif /* _ALPM_ERROR_H */