[Pkg-owncloud-commits] [owncloud-client] 49/69: Logging: Report setModTime failures.

Sandro Knauß hefee-guest at moszumanska.debian.org
Fri Nov 7 19:41:10 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit a49a6bfd8810f2d9decfe5ab4954c84cff8a33ee
Author: Christian Kamm <kamm at incasoftware.de>
Date:   Wed Nov 5 13:20:19 2014 +0100

    Logging: Report setModTime failures.
    
    Ths may be helpful for #2252 and maybe even #2431.
---
 src/mirall/filesystem.cpp | 10 ++++++++--
 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 7c9e000..59e2fbe 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 23bbbbf..71cd1a2 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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list