From 1440c13c8c1ed8eaa99c5d5edbd6fa61fd5eee8b Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 10 Dec 2015 11:37:59 +0100 Subject: Check if the file is writable even while QT_BOOTSTRAPPED QConfFile::isWritable() has the extra effect that it will try and create the path where the file should be if it does not already exist. So this cannot be omitted as 'qmake -set' may be used in a situation where the path does not yet exist. Change-Id: I0113644259f78d090a0687c44cf60d400be9c859 Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qsettings.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/corelib/io') diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index 413f5693f0..52bcb153ae 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -1383,13 +1383,17 @@ void QConfFileSettingsPrivate::syncConfFile(int confFileNo) Concurrent read and write are not a problem because the writing operation is atomic. */ QLockFile lockFile(confFile->name + QLatin1String(".lock")); +#endif if (!readOnly) { - if (!confFile->isWritable() || !lockFile.lock() ) { + if (!confFile->isWritable() +#ifndef QT_BOOTSTRAPPED + || !lockFile.lock() +#endif + ) { setStatus(QSettings::AccessError); return; } } -#endif /* We hold the lock. Let's reread the file if it has changed -- cgit v1.2.3