summaryrefslogtreecommitdiff
path: root/library/global.cpp
Side-by-side diff
Diffstat (limited to 'library/global.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/global.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/library/global.cpp b/library/global.cpp
index 9b3c51e..42c2729 100644
--- a/library/global.cpp
+++ b/library/global.cpp
@@ -606,2 +606,14 @@ void Global::invoke(const QString &c)
{
+ char *oldpre = ::getenv ( "LD_PRELOAD" );
+
+ extern bool opie_block_style;
+
+ QString newpre = QPEApplication::qpeDir ( ) + "/lib/libpreload.so";
+ if ( opie_block_style && QFile::exists ( newpre )) {
+ if ( oldpre && oldpre [0] )
+ newpre = newpre + ":" + oldpre;
+ ::setenv ( "LD_PRELOAD", newpre. latin1( ), 1 );
+ qDebug ( "\nPRELOADING\n" );
+ }
+
if ( !::vfork() ) {
@@ -615,2 +627,6 @@ void Global::invoke(const QString &c)
}
+ if ( oldpre )
+ ::setenv ( "LD_PRELOAD", oldpre, 1 );
+ else
+ ::unsetenv ( "LD_PRELOAD" );
}