summaryrefslogtreecommitdiff
path: root/src/database.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2020-02-04 10:31:10 +0200
committerTimo Teräs <timo.teras@iki.fi>2020-02-04 10:31:10 +0200
commit45d313c51cbae20bce0789db86ba82ff79c9b202 (patch)
treed144b6462d34c1ceeaf26fbc87902d515e346e0b /src/database.c
parent8fc403c582a725b667d0211f9ccd8a217d25c2fc (diff)
downloadapk-tools-45d313c51cbae20bce0789db86ba82ff79c9b202.tar.gz
apk-tools-45d313c51cbae20bce0789db86ba82ff79c9b202.tar.bz2
apk-tools-45d313c51cbae20bce0789db86ba82ff79c9b202.tar.xz
apk-tools-45d313c51cbae20bce0789db86ba82ff79c9b202.zip
remove apk_time() as it is causing problems with shared objects
Instead, to make sure test mode produces same output, redefine time() for the test mode binary. Reverts parts of 0b82bcc53e60.
Diffstat (limited to 'src/database.c')
-rw-r--r--src/database.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/database.c b/src/database.c
index 3f1904f..f358ad1 100644
--- a/src/database.c
+++ b/src/database.c
@@ -624,7 +624,7 @@ int apk_cache_download(struct apk_database *db, struct apk_repository *repo,
char tmpcacheitem[128], *cacheitem = &tmpcacheitem[tmpprefix.len];
apk_blob_t b = APK_BLOB_BUF(tmpcacheitem);
int r, fd;
- time_t now = apk_time();
+ time_t now = time(NULL);
apk_blob_push_blob(&b, tmpprefix);
if (pkg != NULL)
@@ -1008,7 +1008,7 @@ static int apk_db_scriptdb_write(struct apk_database *db, struct apk_ostream *os
char filename[256];
apk_blob_t bfn;
int r, i;
- time_t now = apk_time();
+ time_t now = time(NULL);
list_for_each_entry(ipkg, &db->installed.packages, installed_pkgs_list) {
pkg = ipkg->pkg;