diff options
author | Ritt Konstantin <ritt.ks@gmail.com> | 2011-07-14 12:49:55 (GMT) |
---|---|---|
committer | Harald Fernengel <harald.fernengel@nokia.com> | 2011-07-14 12:49:55 (GMT) |
commit | 90dac1e856e4d3648ce19ae6b356f9aeb090af49 (patch) | |
tree | 0f5b54160dc87c94496f3014c7a5442f63ac2bfc /tools/qvfb | |
parent | 63b4e11ca2e7211e2a444de54eff3a3e233d64ce (diff) | |
download | Qt-90dac1e856e4d3648ce19ae6b356f9aeb090af49.zip Qt-90dac1e856e4d3648ce19ae6b356f9aeb090af49.tar.gz Qt-90dac1e856e4d3648ce19ae6b356f9aeb090af49.tar.bz2 |
sync qws_dataDir() with coreapp's internal qws_dataDir()
Merge-request: 1295
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
Diffstat (limited to 'tools/qvfb')
-rw-r--r-- | tools/qvfb/qvfbshmem.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/tools/qvfb/qvfbshmem.cpp b/tools/qvfb/qvfbshmem.cpp index a03b25d..b05b69c 100644 --- a/tools/qvfb/qvfbshmem.cpp +++ b/tools/qvfb/qvfbshmem.cpp @@ -69,27 +69,40 @@ QT_BEGIN_NAMESPACE // live. static QString qws_dataDir(int qws_display_id) { - QByteArray dataDir = QT_VFB_DATADIR(qws_display_id).toLocal8Bit(); - if (mkdir(dataDir, 0700)) { + static QString result; + if (!result.isEmpty()) + return result; + result = QT_VFB_DATADIR(qws_display_id); + QByteArray dataDir = result.toLocal8Bit(); + +#if defined(Q_OS_INTEGRITY) + /* ensure filesystem is ready before starting requests */ + WaitForFileSystemInitialization(); +#endif + + if (QT_MKDIR(dataDir, 0700)) { if (errno != EEXIST) { qFatal("Cannot create Qt for Embedded Linux data directory: %s", dataDir.constData()); } } - struct stat buf; - if (lstat(dataDir, &buf)) + QT_STATBUF buf; + if (QT_LSTAT(dataDir, &buf)) qFatal("stat failed for Qt for Embedded Linux data directory: %s", dataDir.constData()); if (!S_ISDIR(buf.st_mode)) qFatal("%s is not a directory", dataDir.constData()); + +#if !defined(Q_OS_INTEGRITY) && !defined(Q_OS_VXWORKS) && !defined(Q_OS_QNX) if (buf.st_uid != getuid()) qFatal("Qt for Embedded Linux data directory is not owned by user %uh", getuid()); if ((buf.st_mode & 0677) != 0600) qFatal("Qt for Embedded Linux data directory has incorrect permissions: %s", dataDir.constData()); - dataDir += "/"; +#endif - return QString(dataDir); + result.append(QLatin1Char('/')); + return result; } |