diff options
Diffstat (limited to 'src/mirall')
-rw-r--r-- | src/mirall/filesystem.cpp | 10 | ||||
-rw-r--r-- | src/mirall/filesystem.h | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/mirall/filesystem.cpp b/src/mirall/filesystem.cpp index 7c9e00055..59e2fbe78 100644 --- a/src/mirall/filesystem.cpp +++ b/src/mirall/filesystem.cpp @@ -96,12 +96,18 @@ time_t FileSystem::getModTime(const QString &filename) return result; } -void FileSystem::setModTime(const QString& filename, time_t modTime) +bool FileSystem::setModTime(const QString& filename, time_t modTime) { struct timeval times[2]; times[0].tv_sec = times[1].tv_sec = modTime; times[0].tv_usec = times[1].tv_usec = 0; - c_utimes(filename.toUtf8().data(), times); + int rc = c_utimes(filename.toUtf8().data(), times); + if (rc != 0) { + qDebug() << "Error setting mtime for" << filename + << "failed: rc" << rc << ", errno:" << errno; + return false; + } + return true; } bool FileSystem::renameReplace(const QString& originFileName, const QString& destinationFileName, QString* errorString) diff --git a/src/mirall/filesystem.h b/src/mirall/filesystem.h index 23bbbbf15..71cd1a229 100644 --- a/src/mirall/filesystem.h +++ b/src/mirall/filesystem.h @@ -40,7 +40,7 @@ void OWNCLOUDSYNC_EXPORT setFileHidden(const QString& filename, bool hidden); */ time_t OWNCLOUDSYNC_EXPORT getModTime(const QString &filename); -void setModTime(const QString &filename, time_t modTime); +bool setModTime(const QString &filename, time_t modTime); /** * Rename the file \a originFileName to \a destinationFileName, and overwrite the destination if it |