diff options
author | Iikka Eklund <iikka.eklund@digia.com> | 2011-09-22 13:11:42 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2011-09-22 18:24:42 (GMT) |
commit | 48f64fc7ae9f0e9e8ab07ab60ccd55d3b053dfab (patch) | |
tree | f15761a84a485f2363d42cb930155adffeab173a /src/gui | |
parent | 0d0c1082f74888044713d96deca2d510951d018a (diff) | |
download | Qt-48f64fc7ae9f0e9e8ab07ab60ccd55d3b053dfab.zip Qt-48f64fc7ae9f0e9e8ab07ab60ccd55d3b053dfab.tar.gz Qt-48f64fc7ae9f0e9e8ab07ab60ccd55d3b053dfab.tar.bz2 |
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
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/dialogs/qfiledialog.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index 5e8533e..817cd38 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -880,7 +880,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); |