From 45d313c51cbae20bce0789db86ba82ff79c9b202 Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Tue, 4 Feb 2020 10:31:10 +0200 Subject: 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. --- src/apk.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/apk.c') 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) { -- cgit v1.2.3-70-g09d2