-rw-r--r-- | library/global.cpp | 16 |
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 | |||
@@ -604,6 +604,18 @@ void Global::invoke(const QString &c) | |||
604 | } else | 604 | } else |
605 | #endif | 605 | #endif |
606 | { | 606 | { |
607 | char *oldpre = ::getenv ( "LD_PRELOAD" ); | ||
608 | |||
609 | extern bool opie_block_style; | ||
610 | |||
611 | QString newpre = QPEApplication::qpeDir ( ) + "/lib/libpreload.so"; | ||
612 | if ( opie_block_style && QFile::exists ( newpre )) { | ||
613 | if ( oldpre && oldpre [0] ) | ||
614 | newpre = newpre + ":" + oldpre; | ||
615 | ::setenv ( "LD_PRELOAD", newpre. latin1( ), 1 ); | ||
616 | qDebug ( "\nPRELOADING\n" ); | ||
617 | } | ||
618 | |||
607 | if ( !::vfork() ) { | 619 | if ( !::vfork() ) { |
608 | for ( int fd = 3; fd < 100; fd++ ) | 620 | for ( int fd = 3; fd < 100; fd++ ) |
609 | ::close( fd ); | 621 | ::close( fd ); |
@@ -613,6 +625,10 @@ void Global::invoke(const QString &c) | |||
613 | ::execvp( args[0], (char * const *)args ); | 625 | ::execvp( args[0], (char * const *)args ); |
614 | _exit( -1 ); | 626 | _exit( -1 ); |
615 | } | 627 | } |
628 | if ( oldpre ) | ||
629 | ::setenv ( "LD_PRELOAD", oldpre, 1 ); | ||
630 | else | ||
631 | ::unsetenv ( "LD_PRELOAD" ); | ||
616 | } | 632 | } |
617 | StartingAppList::add( list[0] ); | 633 | StartingAppList::add( list[0] ); |
618 | #endif //QT_NO_QWS_MULTIPROCESS | 634 | #endif //QT_NO_QWS_MULTIPROCESS |