summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hash.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/hash.cxx b/hash.cxx
index e550be76..a0608c03 100644
--- a/hash.cxx
+++ b/hash.cxx
@@ -52,12 +52,12 @@ hash::add_file(const std::string& filename)
{
struct stat st;
- if (stat(filename.c_str(), &st) == 0)
- {
- add(filename);
- add(st.st_size);
- add(st.st_mtime);
- }
+ if (stat(filename.c_str(), &st) != 0)
+ st.st_size = st.st_mtime = -1;
+
+ add(filename);
+ add(st.st_size);
+ add(st.st_mtime);
}