From c60d03831f0eecaf25d2bf97b27884ad1c646a78 Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Tue, 4 Aug 2015 14:03:44 -0400 Subject: [PATCH] use gte rather than gt for mtime comparisons. fixes #91 --- src/policy_newest.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/policy_newest.cpp b/src/policy_newest.cpp index ea7b9eab..27f2deae 100644 --- a/src/policy_newest.cpp +++ b/src/policy_newest.cpp @@ -29,6 +29,7 @@ #include #include +#include #include "policy.hpp" @@ -42,11 +43,9 @@ _newest(const vector &basepaths, const string &fusepath, vector &paths) { - time_t newest; - const char *neweststr; + time_t newest = std::numeric_limits::min(); + const char *neweststr = NULL; - newest = 0; - neweststr = NULL; for(size_t i = 0, ei = basepaths.size(); i != ei; i++) { int rv; @@ -58,7 +57,7 @@ _newest(const vector &basepaths, fullpath = fs::path::make(basepath,fusepath); rv = ::lstat(fullpath.c_str(),&st); - if(rv == 0 && st.st_mtime > newest) + if(rv == 0 && st.st_mtime >= newest) { newest = st.st_mtime; neweststr = basepath;