From 34b604cdfef182f10922d05d4a41302b4d7a0f3f Mon Sep 17 00:00:00 2001 From: Takeshi Nakatani Date: Sat, 14 May 2016 09:03:52 +0000 Subject: [PATCH] Fixed a bug about stat_cache_expire - #382 --- src/cache.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cache.cpp b/src/cache.cpp index 83d148d..a4ba770 100644 --- a/src/cache.cpp +++ b/src/cache.cpp @@ -104,7 +104,9 @@ inline int CompareStatCacheTime(struct timespec& ts1, struct timespec& ts2) inline bool IsExpireStatCacheTime(const struct timespec& ts, const time_t& expire) { - return ((ts.tv_sec + expire) < time(NULL)); + struct timespec nowts; + SetStatCacheTime(nowts); + return ((ts.tv_sec + expire) < nowts.tv_sec); } //