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

QFileDialog won't compile on Solaris

    XMLWordPrintable

Details

    • 48f64fc7ae9f0e9e8ab07ab60ccd55d3b053dfab; a10768455352eb3e49b2123234cd096a032d3474

    Description

      QTBUG-3265 is included in 4.8 which causes compilation error on Solaris.

      In qfiledialog.cpp: qt_tildeExpansion() calls system function "getpwnam_r()"

      which has two definitions depending on the _POSIX_C_SOURCE version (see pwd.h):

      int getpwnam_r(const char *, struct passwd *, char *, int, struct passwd **);
      struct passwd *getpwnam_r(const char *, struct passwd *, char *, int);

      Current version of "qt_tildeExpansion()" assumes that the first definition is always used.
      But this is broken when the _POSIX_C_SOURCE is less than 199506L

      Proposal is to slightly modify the code as follows:

      ...
      int err = 0;
      #if defined(Q_OS_SOLARIS) && defined(_POSIX_C_SOURCE - 0 >= 199506L)
      tmpPw = getpwnam_r(userName.toLocal8Bit().constData(), &pw, buf, bufSize);
      #else
      err = getpwnam_r(userName.toLocal8Bit().constData(), &pw, buf, bufSize, &tmpPw);
      #endif
      ...
      

      Attachments

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

        Activity

          People

            sapiippo Samuli Piippo
            iknd Iikka Eklund
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes