From ee10fbaa5ee61fe289d630732c443c7c475f4e94 Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@intel.com>
Date: Thu, 2 Oct 2014 11:56:22 -0700
Subject: [PATCH] Report the system error on why chmod(2) failed in
 XDG_RNTIME_DIR

Why would chmod(2) fail if the current user is the owner of the file? The
only reason I can think of is EROFS.

Task-number: QTBUG-41735
Change-Id: I8f8bac763bf5a6e575ed59dac55bd265e5b66271
---
 src/corelib/io/qstandardpaths_unix.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- qtbase/src/corelib/io/qstandardpaths_unix.cpp
+++ qtbase/src/corelib/io/qstandardpaths_unix.cpp
@@ -143,7 +143,8 @@
         const QFile::Permissions wantedPerms = QFile::ReadUser | QFile::WriteUser | QFile::ExeUser
                                                | QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner;
         if (file.permissions() != wantedPerms && !file.setPermissions(wantedPerms)) {
-            qWarning("QStandardPaths: wrong permissions on runtime directory %s", qPrintable(xdgRuntimeDir));
+            qWarning("QStandardPaths: could not set correct permissions on runtime directory %s: %s",
+                     qPrintable(xdgRuntimeDir), qPrintable(file.errorString()));
             return QString();
         }
         return xdgRuntimeDir;
