summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2017-05-11 06:42:19 +0200
committerAndrew Gregory <andrew.gregory.8@gmail.com>2017-05-11 06:45:30 +0200
commit9997d0f6931ba7ea6cf4a0fdc1fef13e941ae3f2 (patch)
tree379dd9725926180154ac21cd78efedb82b805239
parent153d3e1a68a071dfcee535a24d23fa1c054fe70a (diff)
downloadpacman-9997d0f6931ba7ea6cf4a0fdc1fef13e941ae3f2.tar.gz
pacman-9997d0f6931ba7ea6cf4a0fdc1fef13e941ae3f2.tar.xz
wip
-rw-r--r--lib/libalpm/be_sync.c4
-rw-r--r--lib/libalpm/log.c2
-rw-r--r--lib/libalpm/package.c4
-rw-r--r--lib/libalpm/sync.c2
-rw-r--r--lib/libalpm/trans.c8
-rw-r--r--lib/libalpm/util.h2
6 files changed, 11 insertions, 11 deletions
diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c
index cf91e3c9..77f71956 100644
--- a/lib/libalpm/be_sync.c
+++ b/lib/libalpm/be_sync.c
@@ -328,9 +328,9 @@ int SYMEXPORT alpm_db_update(int force, alpm_db_t *db)
if(ret == -1) {
/* pm_errno was set by the download code */
_alpm_log(handle, ALPM_LOG_DEBUG, "failed to sync db: %s\n",
- alpm_strerror(handle->pm_errno));
+ alpm_strerror(alpm_errno(handle)));
} else {
- handle->pm_errno = ALPM_ERR_OK;
+ _alpm_set_errno(handle, ALPM_ERR_OK);
}
_alpm_handle_unlock(handle);
diff --git a/lib/libalpm/log.c b/lib/libalpm/log.c
index 26f811e5..6cb18f30 100644
--- a/lib/libalpm/log.c
+++ b/lib/libalpm/log.c
@@ -103,7 +103,7 @@ int SYMEXPORT alpm_logaction(alpm_handle_t *handle, const char *prefix,
if(_alpm_log_leader(handle->logstream, prefix) < 0
|| vfprintf(handle->logstream, fmt, args) < 0) {
ret = -1;
- handle->pm_errno = ALPM_ERR_SYSTEM;
+ _alpm_set_errno(handle, ALPM_ERR_SYSTEM);
}
fflush(handle->logstream);
}
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c
index 528b18e5..cf233127 100644
--- a/lib/libalpm/package.c
+++ b/lib/libalpm/package.c
@@ -342,14 +342,14 @@ alpm_list_t SYMEXPORT *alpm_pkg_get_optdepends(alpm_pkg_t *pkg)
alpm_list_t SYMEXPORT *alpm_pkg_get_checkdepends(alpm_pkg_t *pkg)
{
ASSERT(pkg != NULL, return NULL);
- pkg->handle->pm_errno = ALPM_ERR_OK;
+ _alpm_set_errno(pkg->handle, ALPM_ERR_OK);
return pkg->ops->get_checkdepends(pkg);
}
alpm_list_t SYMEXPORT *alpm_pkg_get_makedepends(alpm_pkg_t *pkg)
{
ASSERT(pkg != NULL, return NULL);
- pkg->handle->pm_errno = ALPM_ERR_OK;
+ _alpm_set_errno(pkg->handle, ALPM_ERR_OK);
return pkg->ops->get_makedepends(pkg);
}
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 57e83317..249c73a6 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -1122,7 +1122,7 @@ struct validity {
alpm_pkg_t *pkg;
char *path;
alpm_siglist_t *siglist;
- alpm_siglevel_t level;
+ alpm_siglevel_t siglevel;
alpm_pkgvalidation_t validation;
alpm_errno_t error;
};
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index 7689079b..c142ea3b 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -204,17 +204,17 @@ int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data)
if(trans->add == NULL) {
if(_alpm_remove_packages(handle, 1) == -1) {
/* pm_errno is set by _alpm_remove_packages() */
- alpm_errno_t save = handle->pm_errno;
+ alpm_errno_t save = alpm_errno(handle);
alpm_logaction(handle, ALPM_CALLER_PREFIX, "transaction failed\n");
- handle->pm_errno = save;
+ _alpm_set_errno(handle, save);
return -1;
}
} else {
if(_alpm_sync_commit(handle) == -1) {
/* pm_errno is set by _alpm_sync_commit() */
- alpm_errno_t save = handle->pm_errno;
+ alpm_errno_t save = alpm_errno(handle);
alpm_logaction(handle, ALPM_CALLER_PREFIX, "transaction failed\n");
- handle->pm_errno = save;
+ _alpm_set_errno(handle, save);
return -1;
}
}
diff --git a/lib/libalpm/util.h b/lib/libalpm/util.h
index d63cca74..eabc8dfc 100644
--- a/lib/libalpm/util.h
+++ b/lib/libalpm/util.h
@@ -72,7 +72,7 @@ void _alpm_alloc_fail(size_t size);
return (ret); } while(0)
#define RET_ERR_ASYNC_SAFE(handle, err, ret) do { \
- (handle)->pm_errno = (err); \
+ _alpm_set_errno(handle, err); \
return (ret); } while(0)
#define DOUBLE_EQ(x, y) (fabs((x) - (y)) < DBL_EPSILON)