From 9c2ce91a364c22f9b232eb40f3c2a392360ed21c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Sun, 7 Sep 2014 00:51:53 +0200 Subject: Fix FTBFS on Linux specific memlock code --- src/tools/qstring.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/tools') diff --git a/src/tools/qstring.cpp b/src/tools/qstring.cpp index 927669c61..67de50301 100644 --- a/src/tools/qstring.cpp +++ b/src/tools/qstring.cpp @@ -1075,9 +1075,11 @@ TQStringData::~TQStringData() { 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* TQString::ascii() const 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; } } -- cgit v1.2.1