Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/error.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-06-07 16:06:16 -0500
committerDan McGee <dan@archlinux.org>2011-06-13 19:38:38 -0500
commite2aa952689da8763d534d1c19310eb97009f4f76 (patch)
tree7d022d67801bc01c24fef985feb9a617c48d316a /lib/libalpm/error.c
parent8b62d9bc0ade64897990b8fc6a1b6a54b629cb5b (diff)
Move pm_errno onto the handle
This involves some serious changes and a very messy diff, unfortunately. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/error.c')
-rw-r--r--lib/libalpm/error.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/libalpm/error.c b/lib/libalpm/error.c
index 294ec214..d893f866 100644
--- a/lib/libalpm/error.c
+++ b/lib/libalpm/error.c
@@ -29,15 +29,12 @@
#include "alpm.h"
#include "handle.h"
-/* global handle variable */
-extern pmhandle_t *handle;
-
-const char SYMEXPORT *alpm_strerrorlast(void)
+enum _pmerrno_t SYMEXPORT alpm_errno(pmhandle_t *handle)
{
- return alpm_strerror(pm_errno);
+ return handle->pm_errno;
}
-const char SYMEXPORT *alpm_strerror(int err)
+const char SYMEXPORT *alpm_strerror(enum _pmerrno_t err)
{
switch(err) {
/* System */
@@ -140,8 +137,6 @@ const char SYMEXPORT *alpm_strerror(int err)
/* Miscellaenous */
case PM_ERR_RETRIEVE:
return _("failed to retrieve some files");
- case PM_ERR_WRITE:
- return _("failed to copy some file");
case PM_ERR_INVALID_REGEX:
return _("invalid regular expression");
/* Errors from external libraries- our own wrapper error */
@@ -151,12 +146,7 @@ const char SYMEXPORT *alpm_strerror(int err)
* error string instead. */
return _("libarchive error");
case PM_ERR_LIBCURL:
-#ifdef HAVE_LIBCURL
- return curl_easy_strerror(handle->curlerr);
-#else
- /* obviously shouldn't get here... */
return _("download library error");
-#endif
case PM_ERR_GPGME:
return _("gpgme error");
case PM_ERR_EXTERNAL_DOWNLOAD: