X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/e7eb3a2744aa45179daea235800753d3d1955338..7f97fda7b59bd9d3beb9bd4591a4e6dea9efccab:/lib/cache.c diff --git a/lib/cache.c b/lib/cache.c index e0f69ef..52629de 100644 --- a/lib/cache.c +++ b/lib/cache.c @@ -24,6 +24,7 @@ #include "hash.h" #include "mem.h" #include "log.h" +#include "syscalls.h" #include "cache.h" /** @brief The global cache */ @@ -60,7 +61,7 @@ void cache_put(const struct cache_type *type, c = xmalloc(sizeof *c); c->type = type; c->value = value; - time(&c->birth); + xtime(&c->birth); hash_add(h, key, c, HASH_INSERT_OR_REPLACE); } @@ -75,7 +76,7 @@ const void *cache_get(const struct cache_type *type, const char *key) { if(h && (c = hash_find(h, key)) && c->type == type - && !expired(c, time(0))) + && !expired(c, xtime(0))) return c->value; else return 0; @@ -98,7 +99,7 @@ void cache_expire(void) { time_t now; if(h) { - time(&now); + xtime(&now); hash_foreach(h, expiry_callback, &now); } }