Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Kamm <kamm@incasoftware.de>2014-11-05 15:20:19 +0300
committerChristian Kamm <kamm@incasoftware.de>2014-11-05 15:20:19 +0300
commita49a6bfd8810f2d9decfe5ab4954c84cff8a33ee (patch)
tree0f732357b464172c19519cf15199f4c5c66acfde /src/mirall
parentb87931c0a906a5192ff9b56ff976a9ec4799ebf5 (diff)
Logging: Report setModTime failures.
Ths may be helpful for #2252 and maybe even #2431.
Diffstat (limited to 'src/mirall')
-rw-r--r--src/mirall/filesystem.cpp10
-rw-r--r--src/mirall/filesystem.h2
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