diff options
author | François Andriot <[email protected]> | 2014-09-07 00:51:50 +0200 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2014-09-07 00:51:50 +0200 |
commit | e17513956503963f4d468342a5be6a0967aca97c (patch) | |
tree | 4055c4a497a5c3725705daa55822c99a6361aebe /src/tools | |
parent | a28cbf4837fbb1094ff790bf53cbec2dcab94a60 (diff) | |
download | qt3-e17513956503963f4d468342a5be6a0967aca97c.tar.gz qt3-e17513956503963f4d468342a5be6a0967aca97c.zip |
Fix FTBFS on Linux specific memlock code
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/qstring.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tools/qstring.cpp b/src/tools/qstring.cpp index 210848c..1c796fe 100644 --- a/src/tools/qstring.cpp +++ b/src/tools/qstring.cpp @@ -1075,9 +1075,11 @@ QStringData::~QStringData() { 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 @@ const char* QString::ascii() const void QString::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; } } |