summaryrefslogtreecommitdiff
path: root/src/apk.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/apk.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/apk.c')
-rw-r--r--src/apk.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/apk.c b/src/apk.c
index 2b4a41d..68050cd 100644
--- a/src/apk.c
+++ b/src/apk.c
@@ -47,14 +47,14 @@ static struct apk_string_array *test_repos;
char **apk_argv;
-time_t apk_time(void)
-{
#ifdef TEST_MODE
- return 1559567666;
-#else
- return time(NULL);
-#endif
+time_t time(time_t *tloc)
+{
+ const time_t val = 1559567666;
+ if (tloc) *tloc = val;
+ return val;
}
+#endif
static void version(void)
{