From 1749bab56538316a579c8f02da0bdaadfe75c11d Mon Sep 17 00:00:00 2001 From: Matt Hoosier Date: Wed, 25 Sep 2013 08:22:45 -0500 Subject: 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 --- src/corelib/io/qfilesystemengine_unix.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/corelib') 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; -- cgit v1.2.3