Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-32414

QDir::mkpath fails on Solaris NFS mounts

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.1.0
    • Fix Version/s: None
    • Component/s: Core: I/O
    • Labels:
      None
    • Environment:
      Solaris 10 (SunOS 5.10 Generic_147441-01 i86pc i386 i86pc Solaris)

      Description

      The fix for race condition (QTBUG-30046) made QDir::mkpath fail when trying to create a directory which already exists under an NFS mount on Solaris

      Solaris NFS has a bug (see e.g. http://www.unix.com/solaris/121565-mkdir-operation-not-applicable.html) which makes sometimes mkdir call return errno == ENOSYS

      The problem is that the error is returned for parent directory instead of EEXIST.

      After choosing to run mkdir before stat createDirectory fails however in my case ENOSYS was only returned for the root directory of NFS mount and directories at larger depth can be created with no problem

      This is a quick fix which made QDir::mkpath work for me:

      if (QT_MKDIR(chunk.constData(), 0777) != 0) {
      switch (errno)

      { case EEXIST: #ifdef Q_OS_SOLARIS case ENOSYS: #endif QT_STATBUF st; if (QT_STAT(chunk.constData(), &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR) continue; }

      return false;
      }

      I am not sure if Solaris is the only operating system with this problem, maybe the #ifdef is not necessary

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              srutledg Shawn Rutledge
              Reporter:
              koval Piotr Kowalski
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes