summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIikka Eklund <iikka.eklund@digia.com>2011-09-22 15:11:42 +0200
committerQt by Nokia <qt-info@nokia.com>2011-11-18 20:25:53 +0100
commitebf5f42edb1e629ca3e75058d65d6dc4a6889b86 (patch)
tree942f9a7cc4849459db72c3a570c32dd33bc922bd
parentb2aac995b93b2663487cb6c8240d22cf1e103e7d (diff)
Fix broken Solaris build (getpwnam_r usage)
Added ifdef inside qt_tildeExpansion function to use correct version of getpwnam_r depending on _C_POSIX_SOURCE version on Solaris platform. Task-number: QTBUG-21451 Merge-request: 1380 Reviewed-by: ossi (cherry picked from commit 48f64fc7ae9f0e9e8ab07ab60ccd55d3b053dfab) Change-Id: I48f64fc7ae9f0e9e8ab07ab60ccd55d3b053dfab Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index e284076286..0f107c6b0a 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -871,7 +871,12 @@ Q_AUTOTEST_EXPORT QString qt_tildeExpansion(const QString &path, bool *expanded
passwd *tmpPw;
char buf[200];
const int bufSize = sizeof(buf);
- int err = getpwnam_r(userName.toLocal8Bit().constData(), &pw, buf, bufSize, &tmpPw);
+ int err = 0;
+#if defined(Q_OS_SOLARIS) && (_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
if (err || !tmpPw)
return ret;
const QString homePath = QString::fromLocal8Bit(pw.pw_dir);