-rw-r--r-- | library/global.cpp | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/library/global.cpp b/library/global.cpp index 2162e02..d6ba84f 100644 --- a/library/global.cpp +++ b/library/global.cpp | |||
@@ -590,56 +590,42 @@ void Global::invoke(const QString &c) | |||
590 | args[j] = NULL; | 590 | args[j] = NULL; |
591 | 591 | ||
592 | #if !defined(QT_NO_COP) | 592 | #if !defined(QT_NO_COP) |
593 | // an attempt to show a wait... | 593 | // an attempt to show a wait... |
594 | // more logic should be used, but this will be fine for the moment... | 594 | // more logic should be used, but this will be fine for the moment... |
595 | QCopEnvelope ( "QPE/System", "busy()" ); | 595 | QCopEnvelope ( "QPE/System", "busy()" ); |
596 | #endif | 596 | #endif |
597 | 597 | ||
598 | #ifdef HAVE_QUICKEXEC | 598 | #ifdef HAVE_QUICKEXEC |
599 | QString libexe = qpeDir()+"/binlib/lib"+args[0] + ".so"; | 599 | QString libexe = qpeDir()+"/binlib/lib"+args[0] + ".so"; |
600 | qDebug("libfile = %s", libexe.latin1() ); | 600 | qDebug("libfile = %s", libexe.latin1() ); |
601 | if ( QFile::exists( libexe ) ) { | 601 | if ( QFile::exists( libexe ) ) { |
602 | qDebug("calling quickexec %s", libexe.latin1() ); | 602 | qDebug("calling quickexec %s", libexe.latin1() ); |
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 | QString newpre = QPEApplication::qpeDir ( ) + "/lib/libpreload.so"; | ||
610 | if ( QFile::exists ( newpre )) { | ||
611 | if ( oldpre && oldpre [0] ) | ||
612 | newpre = newpre + ":" + oldpre; | ||
613 | ::setenv ( "LD_PRELOAD", newpre. latin1( ), 1 ); | ||
614 | qDebug ( "\nPRELOADING\n" ); | ||
615 | } | ||
616 | |||
617 | if ( !::vfork() ) { | 607 | if ( !::vfork() ) { |
618 | for ( int fd = 3; fd < 100; fd++ ) | 608 | for ( int fd = 3; fd < 100; fd++ ) |
619 | ::close( fd ); | 609 | ::close( fd ); |
620 | ::setpgid( ::getpid(), ::getppid() ); | 610 | ::setpgid( ::getpid(), ::getppid() ); |
621 | // Try bindir first, so that foo/bar works too | 611 | // Try bindir first, so that foo/bar works too |
622 | ::execv( qpeDir()+"/bin/"+args[0], (char * const *)args ); | 612 | ::execv( qpeDir()+"/bin/"+args[0], (char * const *)args ); |
623 | ::execvp( args[0], (char * const *)args ); | 613 | ::execvp( args[0], (char * const *)args ); |
624 | _exit( -1 ); | 614 | _exit( -1 ); |
625 | } | 615 | } |
626 | if ( oldpre ) | ||
627 | ::setenv ( "LD_PRELOAD", oldpre, 1 ); | ||
628 | else | ||
629 | ::unsetenv ( "LD_PRELOAD" ); | ||
630 | } | 616 | } |
631 | StartingAppList::add( list[0] ); | 617 | StartingAppList::add( list[0] ); |
632 | #endif //QT_NO_QWS_MULTIPROCESS | 618 | #endif //QT_NO_QWS_MULTIPROCESS |
633 | } | 619 | } |
634 | 620 | ||
635 | 621 | ||
636 | /*! | 622 | /*! |
637 | Executes the application identfied by \a c, passing \a | 623 | Executes the application identfied by \a c, passing \a |
638 | document if it isn't null. | 624 | document if it isn't null. |
639 | 625 | ||
640 | Note that a better approach might be to send a QCop message to the | 626 | Note that a better approach might be to send a QCop message to the |
641 | application's QPE/Application/\e{appname} channel. | 627 | application's QPE/Application/\e{appname} channel. |
642 | */ | 628 | */ |
643 | void Global::execute( const QString &c, const QString& document ) | 629 | void Global::execute( const QString &c, const QString& document ) |
644 | { | 630 | { |
645 | if ( qApp->type() != QApplication::GuiServer ) { | 631 | if ( qApp->type() != QApplication::GuiServer ) { |