1 diff -up qt-everywhere-opensource-src-4.8.3/src/corelib/io/qfilesystemengine_unix.cpp.QTBUG-4862 qt-everywhere-opensource-src-4.8.3/src/corelib/io/qfilesystemengine_unix.cpp
2 --- qt-everywhere-opensource-src-4.8.3/src/corelib/io/qfilesystemengine_unix.cpp.QTBUG-4862 2012-09-10 20:36:50.000000000 -0500
3 +++ qt-everywhere-opensource-src-4.8.3/src/corelib/io/qfilesystemengine_unix.cpp 2012-10-22 14:16:42.672111081 -0500
4 @@ -624,6 +624,25 @@ QString QFileSystemEngine::homePath()
6 QString home = QFile::decodeName(qgetenv("HOME"));
9 +#if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD)
10 + int size_max = sysconf(_SC_GETPW_R_SIZE_MAX);
13 + QVarLengthArray<char, 1024> buf(size_max);
15 + struct passwd *pw = 0;
16 + uid_t user_id = getuid();
17 + pw = getpwuid(user_id);
18 +#if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD)
19 + struct passwd entry;
20 + getpwuid_r(user_id, &entry, buf.data(), buf.size(), &pw);
22 + pw = getpwuid(user_id);
24 + home = QFile::decodeName(QByteArray(pw->pw_dir));
28 return QDir::cleanPath(home);