X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/812b526d127c6657e571db8b33a58137af6709cd..b78709940eae7782a365f158d4a89b2f2d6bfea6:/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); } }