author | zecke <zecke> | 2003-12-20 13:06:29 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-12-20 13:06:29 (UTC) |
commit | d9ffcee06ec97f4a9e00ff0a9071d7a58e5075a1 (patch) (unidiff) | |
tree | 1d808cf09131926e6ab6a00e75d9b92182c49365 | |
parent | afabf4e4cb1211dd17e0ba0ff77133335d4735b9 (diff) | |
download | opie-d9ffcee06ec97f4a9e00ff0a9071d7a58e5075a1.zip opie-d9ffcee06ec97f4a9e00ff0a9071d7a58e5075a1.tar.gz opie-d9ffcee06ec97f4a9e00ff0a9071d7a58e5075a1.tar.bz2 |
Do not use LD_BIND_NOW for now.
I hope ljp gets some numbers for that soon...
-rw-r--r-- | core/launcher/applauncher.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/core/launcher/applauncher.cpp b/core/launcher/applauncher.cpp index 0ac043b..0db99dd 100644 --- a/core/launcher/applauncher.cpp +++ b/core/launcher/applauncher.cpp | |||
@@ -611,97 +611,104 @@ bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRais | |||
611 | return TRUE; | 611 | return TRUE; |
612 | } | 612 | } |
613 | 613 | ||
614 | void AppLauncher::kill( int pid ) | 614 | void AppLauncher::kill( int pid ) |
615 | { | 615 | { |
616 | #ifndef Q_OS_WIN32 | 616 | #ifndef Q_OS_WIN32 |
617 | ::kill( pid, SIGTERM ); | 617 | ::kill( pid, SIGTERM ); |
618 | #else | 618 | #else |
619 | for ( QProcess *proc = runningAppsProc.first(); proc; proc = runningAppsProc.next() ) { | 619 | for ( QProcess *proc = runningAppsProc.first(); proc; proc = runningAppsProc.next() ) { |
620 | if ( proc->processIdentifier() == pid ) { | 620 | if ( proc->processIdentifier() == pid ) { |
621 | proc->kill(); | 621 | proc->kill(); |
622 | break; | 622 | break; |
623 | } | 623 | } |
624 | } | 624 | } |
625 | #endif | 625 | #endif |
626 | } | 626 | } |
627 | 627 | ||
628 | int AppLauncher::pidForName( const QString &appName ) | 628 | int AppLauncher::pidForName( const QString &appName ) |
629 | { | 629 | { |
630 | int pid = -1; | 630 | int pid = -1; |
631 | 631 | ||
632 | QMap<int, QString>::Iterator it; | 632 | QMap<int, QString>::Iterator it; |
633 | for (it = runningApps.begin(); it!= runningApps.end(); ++it) { | 633 | for (it = runningApps.begin(); it!= runningApps.end(); ++it) { |
634 | if (*it == appName) { | 634 | if (*it == appName) { |
635 | pid = it.key(); | 635 | pid = it.key(); |
636 | break; | 636 | break; |
637 | } | 637 | } |
638 | } | 638 | } |
639 | 639 | ||
640 | return pid; | 640 | return pid; |
641 | } | 641 | } |
642 | 642 | ||
643 | void AppLauncher::createQuickLauncher() | 643 | void AppLauncher::createQuickLauncher() |
644 | { | 644 | { |
645 | static bool disabled = FALSE; | 645 | static bool disabled = FALSE; |
646 | if (disabled) | 646 | if (disabled) |
647 | return; | 647 | return; |
648 | 648 | ||
649 | qlReady = FALSE; | 649 | qlReady = FALSE; |
650 | qlPid = ::vfork(); | 650 | qlPid = ::vfork(); |
651 | if ( !qlPid ) { | 651 | if ( !qlPid ) { |
652 | char **args = new char *[2]; | 652 | char **args = new char *[2]; |
653 | args[0] = "quicklauncher"; | 653 | args[0] = "quicklauncher"; |
654 | args[1] = 0; | 654 | args[1] = 0; |
655 | for ( int fd = 3; fd < 100; fd++ ) | 655 | for ( int fd = 3; fd < 100; fd++ ) |
656 | ::close( fd ); | 656 | ::close( fd ); |
657 | ::setpgid( ::getpid(), ::getppid() ); | 657 | ::setpgid( ::getpid(), ::getppid() ); |
658 | // Try bindir first, so that foo/bar works too | 658 | // Try bindir first, so that foo/bar works too |
659 | setenv( "LD_BIND_NOW", "1", 1 ); | 659 | /* |
660 | * LD_BIND_NOW will change the behaviour of ld.so and dlopen | ||
661 | * RTLD_LAZY will be made RTLD_NOW which leads to problem | ||
662 | * with miscompiled libraries... if LD_BIND_NOW is set.. there | ||
663 | * is no way back.. We will wait for numbers from TT to see | ||
664 | * if using LD_BIND_NOW is worth it - zecke | ||
665 | */ | ||
666 | //setenv( "LD_BIND_NOW", "1", 1 ); | ||
660 | ::execv( QPEApplication::qpeDir()+"bin/quicklauncher", args ); | 667 | ::execv( QPEApplication::qpeDir()+"bin/quicklauncher", args ); |
661 | ::execvp( "quicklauncher", args ); | 668 | ::execvp( "quicklauncher", args ); |
662 | delete []args; | 669 | delete []args; |
663 | disabled = TRUE; | 670 | disabled = TRUE; |
664 | _exit( -1 ); | 671 | _exit( -1 ); |
665 | } else if ( qlPid == -1 ) { | 672 | } else if ( qlPid == -1 ) { |
666 | qlPid = 0; | 673 | qlPid = 0; |
667 | } else { | 674 | } else { |
668 | if ( getuid() == 0 ) | 675 | if ( getuid() == 0 ) |
669 | setpriority( PRIO_PROCESS, qlPid, 19 ); | 676 | setpriority( PRIO_PROCESS, qlPid, 19 ); |
670 | } | 677 | } |
671 | } | 678 | } |
672 | 679 | ||
673 | // Used only by Win32 | 680 | // Used only by Win32 |
674 | void AppLauncher::processExited() | 681 | void AppLauncher::processExited() |
675 | { | 682 | { |
676 | #ifdef Q_OS_WIN32 | 683 | #ifdef Q_OS_WIN32 |
677 | qDebug("AppLauncher::processExited()"); | 684 | qDebug("AppLauncher::processExited()"); |
678 | bool found = FALSE; | 685 | bool found = FALSE; |
679 | QProcess *proc = (QProcess *) sender(); | 686 | QProcess *proc = (QProcess *) sender(); |
680 | if (!proc){ | 687 | if (!proc){ |
681 | qDebug("Interanl error NULL proc"); | 688 | qDebug("Interanl error NULL proc"); |
682 | return; | 689 | return; |
683 | } | 690 | } |
684 | 691 | ||
685 | QString appName = proc->arguments()[0]; | 692 | QString appName = proc->arguments()[0]; |
686 | qDebug("Removing application %s", appName.latin1()); | 693 | qDebug("Removing application %s", appName.latin1()); |
687 | runningAppsProc.remove(proc); | 694 | runningAppsProc.remove(proc); |
688 | 695 | ||
689 | QMap<QString,int>::Iterator hbit = waitingHeartbeat.find(appName); | 696 | QMap<QString,int>::Iterator hbit = waitingHeartbeat.find(appName); |
690 | if ( hbit != waitingHeartbeat.end() ) { | 697 | if ( hbit != waitingHeartbeat.end() ) { |
691 | killTimer( *hbit ); | 698 | killTimer( *hbit ); |
692 | waitingHeartbeat.remove( hbit ); | 699 | waitingHeartbeat.remove( hbit ); |
693 | } | 700 | } |
694 | if ( appName == appKillerName ) { | 701 | if ( appName == appKillerName ) { |
695 | appKillerName = QString::null; | 702 | appKillerName = QString::null; |
696 | delete appKillerBox; | 703 | delete appKillerBox; |
697 | appKillerBox = 0; | 704 | appKillerBox = 0; |
698 | } | 705 | } |
699 | 706 | ||
700 | // Search for the app to find its PID | 707 | // Search for the app to find its PID |
701 | QMap<int, QString>::Iterator it; | 708 | QMap<int, QString>::Iterator it; |
702 | for (it = runningApps.begin(); it!= runningApps.end(); ++it){ | 709 | for (it = runningApps.begin(); it!= runningApps.end(); ++it){ |
703 | if (it.data() == appName){ | 710 | if (it.data() == appName){ |
704 | found = TRUE; | 711 | found = TRUE; |
705 | break; | 712 | break; |
706 | } | 713 | } |
707 | } | 714 | } |