summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Hoosier <matt.hoosier@garmin.com>2013-09-25 08:22:45 -0500
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-25 21:07:51 +0200
commit1749bab56538316a579c8f02da0bdaadfe75c11d (patch)
treec6b920db86e47f67d3715d220bfc8a43f6de7045
parent1db90754826730dc810b92f9a741243b90ae8da9 (diff)
Allow QDir::mkpath() to work on QNX QNet paths
Due to a quirk in the way that QNX's mkdir() implementation reports return values when the requested pathname is the mountpoint of a QNet filesystem, the usual recursive directory creation algorithm used by QDir fails if the destination directory happens to exist inside QNet. This is an artificial failure; the desired directory can still be created with the normal mkdir() algorithm. There just needs to error handling in place to allow the recursive creation of parents to recognize this situation. Change-Id: I350fd9cb39858570032f9146c1154a9287701569 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
index a7517b4c7f..46d8101e20 100644
--- a/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
@@ -511,7 +511,14 @@ bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool crea
if (slash) {
const QByteArray chunk = QFile::encodeName(dirName.left(slash));
if (QT_MKDIR(chunk.constData(), 0777) != 0) {
- if (errno == EEXIST) {
+ if (errno == EEXIST
+#if defined(Q_OS_QNX)
+ // On QNX the QNet (VFS paths of other hosts mounted under a directory
+ // such as /net) mountpoint returns ENOENT, despite existing. stat()
+ // on the QNet mountpoint returns successfully and reports S_IFDIR.
+ || errno == ENOENT
+#endif
+ ) {
QT_STATBUF st;
if (QT_STAT(chunk.constData(), &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR)
continue;