summaryrefslogtreecommitdiff
path: root/src/app_version.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2020-05-19 11:39:21 +0300
committerTimo Teräs <timo.teras@iki.fi>2020-05-19 12:02:56 +0300
commitd0edeec8fb8fa5abee8b3065cea5e4882d0c51c4 (patch)
tree10dbc6d72c9cef13a26cb539df43e92e4bf78d74 /src/app_version.c
parent12fdf6fc219321d22825042ae08efd322acc0310 (diff)
downloadapk-tools-d0edeec8fb8fa5abee8b3065cea5e4882d0c51c4.tar.gz
apk-tools-d0edeec8fb8fa5abee8b3065cea5e4882d0c51c4.tar.bz2
apk-tools-d0edeec8fb8fa5abee8b3065cea5e4882d0c51c4.tar.xz
apk-tools-d0edeec8fb8fa5abee8b3065cea5e4882d0c51c4.zip
make the atom functions not use global state
This greatly helps with memory management on applications that may want to daemonize and open/close database several times. Also the lifetime and "owner" of memory for all data is now explicitly bound to owning struct apk_database, which might be helpful when writing language bindings. As side effect, the interned "atoms" are unique only within what apk_database, so comparing packages from different apk_database may not work as expected. Fixes #10697
Diffstat (limited to 'src/app_version.c')
-rw-r--r--src/app_version.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/app_version.c b/src/app_version.c
index df2506c..2dc3bcd 100644
--- a/src/app_version.c
+++ b/src/app_version.c
@@ -121,7 +121,7 @@ static void ver_print_package_status(struct apk_database *db, const char *match,
struct apk_provider *p0;
char pkgname[41];
const char *opstr;
- apk_blob_t *latest = apk_blob_atomize(APK_BLOB_STR(""));
+ apk_blob_t *latest = apk_atomize(&db->atoms, APK_BLOB_STR(""));
unsigned int latest_repos = 0;
int i, r = -1;
unsigned short tag, allowed_repos;