From: Matthieu Gallien Date: Tue, 7 Dec 2021 10:48:13 +0000 (+0100) Subject: do not consider that a file has changed if its mtime is invalid X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~17^2~253^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=76c8d7287e1b8ab79b08e7bace53f54acf1f0307;p=nextcloud-desktop.git do not consider that a file has changed if its mtime is invalid a mtime should never be 0 or negative Signed-off-by: Matthieu Gallien --- diff --git a/src/libsync/filesystem.cpp b/src/libsync/filesystem.cpp index 5c6cd4610..d0e9d673e 100644 --- a/src/libsync/filesystem.cpp +++ b/src/libsync/filesystem.cpp @@ -98,7 +98,7 @@ bool FileSystem::verifyFileUnchanged(const QString &fileName, { const qint64 actualSize = getSize(fileName); const time_t actualMtime = getModTime(fileName); - if (actualSize != previousSize || actualMtime != previousMtime) { + if (actualSize != previousSize || (actualMtime != previousMtime && previousMtime > 0 && actualMtime > 0)) { qCInfo(lcFileSystem) << "File" << fileName << "has changed:" << "size: " << previousSize << "<->" << actualSize << ", mtime: " << previousMtime << "<->" << actualMtime;