summaryrefslogtreecommitdiff
path: root/library/global.cpp
Unidiff
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
@@ -603,8 +603,20 @@ void Global::invoke(const QString &c)
603 quickexecv( libexe.utf8().data(), (const char **)args ); 603 quickexecv( libexe.utf8().data(), (const char **)args );
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 );
610 ::setpgid( ::getpid(), ::getppid() ); 622 ::setpgid( ::getpid(), ::getppid() );
@@ -612,8 +624,12 @@ void Global::invoke(const QString &c)
612 ::execv( qpeDir()+"/bin/"+args[0], (char * const *)args ); 624 ::execv( qpeDir()+"/bin/"+args[0], (char * const *)args );
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
619} 635}