From e2aa952689da8763d534d1c19310eb97009f4f76 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 7 Jun 2011 16:06:16 -0500 Subject: Move pm_errno onto the handle This involves some serious changes and a very messy diff, unfortunately. Signed-off-by: Dan McGee --- src/pacman/util.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/pacman/util.c') diff --git a/src/pacman/util.c b/src/pacman/util.c index af422fe9..a71c3cfd 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -60,14 +60,15 @@ int trans_init(pmtransflag_t flags) } if(ret == -1) { + enum _pmerrno_t err = alpm_errno(config->handle); pm_fprintf(stderr, PM_LOG_ERROR, _("failed to init transaction (%s)\n"), - alpm_strerrorlast()); - if(pm_errno == PM_ERR_HANDLE_LOCK) { + alpm_strerror(err)); + if(err == PM_ERR_HANDLE_LOCK) { fprintf(stderr, _(" if you're sure a package manager is not already\n" " running, you can remove %s\n"), alpm_option_get_lockfile(config->handle)); } - else if(pm_errno == PM_ERR_DB_VERSION) { + else if(err == PM_ERR_DB_VERSION) { fprintf(stderr, _(" try running pacman-db-upgrade\n")); } @@ -80,7 +81,7 @@ int trans_release(void) { if(alpm_trans_release(config->handle) == -1) { pm_fprintf(stderr, PM_LOG_ERROR, _("failed to release transaction (%s)\n"), - alpm_strerrorlast()); + alpm_strerror(alpm_errno(config->handle))); return -1; } return 0; -- cgit v1.2.3-24-g4f1b