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(-)
|
|
|
143 | 143 | const QFile::Permissions wantedPerms = QFile::ReadUser | QFile::WriteUser | QFile::ExeUser |
144 | 144 | | QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner; |
145 | 145 | if (file.permissions() != wantedPerms && !file.setPermissions(wantedPerms)) { |
146 | | qWarning("QStandardPaths: wrong permissions on runtime directory %s", qPrintable(xdgRuntimeDir)); |
| 146 | qWarning("QStandardPaths: could not set correct permissions on runtime directory %s: %s", |
| 147 | qPrintable(xdgRuntimeDir), qPrintable(file.errorString())); |
147 | 148 | return QString(); |
148 | 149 | } |
149 | 150 | return xdgRuntimeDir; |