6d4396b3 | 2014-09-06 17:45:21 | François Andriot |
Fix FTBFS because invalid data conversion in qmutex |
||
M src/tools/qmutex_unix.cpp |
||
diff --git a/src/tools/qmutex_unix.cpp b/src/tools/qmutex_unix.cpp index 3fff833..df7fd7a 100644 --- a/src/tools/qmutex_unix.cpp +++ b/src/tools/qmutex_unix.cpp @@ -72,6 +72,7 @@ #include "qmutex_p.h" #include <errno.h> +#include <stdint.h> #include <string.h> // Private class declarations @@ -270,8 +271,8 @@ } else { #ifdef QT_CHECK_RANGE tqWarning("TQMutex::unlock: unlock from different thread than locker"); - tqWarning(" was locked by %d, unlock attempt from %d", - (int)owner, (int)pthread_self()); + tqWarning(" was locked by %d, unlock attempt from %lu", + (int)owner, (uintptr_t)pthread_self()); #endif } |
||
9c2ce91a | 2014-09-06 17:51:53 | François Andriot |
Fix FTBFS on Linux specific memlock code |
||
M src/tools/qstring.cpp M src/widgets/qlineedit.cpp |
||
diff --git a/src/tools/qstring.cpp b/src/tools/qstring.cpp index 927669c..67de503 100644 --- a/src/tools/qstring.cpp +++ b/src/tools/qstring.cpp @@ -1075,9 +1075,11 @@ if ( unicode ) { delete[] ((char*)unicode); } +#if defined(Q_OS_LINUX) if ( ascii && security_unpaged ) { munlock(ascii, LINUX_MEMLOCK_LIMIT_BYTES); } +#endif if ( ascii ) { delete[] ascii; } @@ -5953,15 +5955,19 @@ void TQString::setSecurityUnPaged(bool lock) { if (lock != d->security_unpaged) { if (d->security_unpaged) { +#if defined(Q_OS_LINUX) if (d->ascii) { munlock(d->ascii, LINUX_MEMLOCK_LIMIT_BYTES); } +#endif d->security_unpaged = false; } else { +#if defined(Q_OS_LINUX) if (d->ascii) { mlock(d->ascii, LINUX_MEMLOCK_LIMIT_BYTES); } +#endif d->security_unpaged = true; } } diff --git a/src/widgets/qlineedit.cpp b/src/widgets/qlineedit.cpp index 2cc64e0..196e097 100644 --- a/src/widgets/qlineedit.cpp +++ b/src/widgets/qlineedit.cpp @@ -461,7 +461,9 @@ { if ((d->echoMode == NoEcho) || (d->echoMode == Password) || (d->echoMode == PasswordThreeStars)) { d->text.fill(TQChar(0)); +#if defined(Q_OS_LINUX) munlock(d->text.d->unicode, LINUX_MEMLOCK_LIMIT_BYTES); +#endif } delete [] d->maskData; delete d; |