summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2011-02-06 18:43:50 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2011-02-08 11:54:44 (GMT)
commit6b6b13130a95b896202ad09fa349e3f69c2807de (patch)
treec414be67690d8645891915c2de1e93030794bd6d
parent609bcb4f9ab3f8fecd037e9c401891ca4d6f2172 (diff)
downloadQt-6b6b13130a95b896202ad09fa349e3f69c2807de.zip
Qt-6b6b13130a95b896202ad09fa349e3f69c2807de.tar.gz
Qt-6b6b13130a95b896202ad09fa349e3f69c2807de.tar.bz2
Check that _POSIX_THREAD_SAFE_FUNCTIONS is larger than zero.
POSIX allows this symbol to be defined to -1 to indicate that the interfaces aren't present. On FreeBSD 8, it's defined to -1, but the functions are present (supposedly, they don't work -- just stubs). Guessing that OpenBSD is the same. Also removing the QT_NO_THREAD, since Qt can't be built without threading support. It's only used by our bootstrapped tools, which in turn use QCoreApplication only (no QApplication). Reviewed-By: Bradley T. Hughes
-rw-r--r--src/gui/kernel/qapplication_x11.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index 4cdb82f..e0447cc 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -5656,7 +5656,7 @@ static void sm_performSaveYourself(QSessionManagerPrivate* smd)
sm_setProperty(QString::fromLatin1(SmProgram), argument0);
// tell the session manager about our user as well.
struct passwd *entryPtr = 0;
-#if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD)
+#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (_POSIX_THREAD_SAFE_FUNCTIONS - 0 > 0)
QVarLengthArray<char, 1024> buf(qMax<long>(sysconf(_SC_GETPW_R_SIZE_MAX), 1024L));
struct passwd entry;
while (getpwuid_r(geteuid(), &entry, buf.data(), buf.size(), &entryPtr) == ERANGE) {