summaryrefslogtreecommitdiff
path: root/library/global.cpp
Unidiff
Diffstat (limited to 'library/global.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/global.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/library/global.cpp b/library/global.cpp
index 90954fe..05d23ac 100644
--- a/library/global.cpp
+++ b/library/global.cpp
@@ -583,49 +583,53 @@ void Global::invoke(const QString &c)
583 583
584#endif 584#endif
585 585
586#ifdef QT_NO_QWS_MULTIPROCESS 586#ifdef QT_NO_QWS_MULTIPROCESS
587 QMessageBox::warning( 0, "Error", "Could not find the application " + c, "Ok", 0, 0, 0, 1 ); 587 QMessageBox::warning( 0, "Error", "Could not find the application " + c, "Ok", 0, 0, 0, 1 );
588#else 588#else
589 589
590 QStrList slist; 590 QStrList slist;
591 unsigned int j; 591 unsigned int j;
592 for ( j = 0; j < list.count(); j++ ) 592 for ( j = 0; j < list.count(); j++ )
593 slist.append( list[j].utf8() ); 593 slist.append( list[j].utf8() );
594 594
595 const char **args = new (const char *)[slist.count() + 1]; 595 const char **args = new (const char *)[slist.count() + 1];
596 for ( j = 0; j < slist.count(); j++ ) 596 for ( j = 0; j < slist.count(); j++ )
597 args[j] = slist.at(j); 597 args[j] = slist.at(j);
598 args[j] = NULL; 598 args[j] = NULL;
599 599
600#if !defined(QT_NO_COP) 600#if !defined(QT_NO_COP)
601 // an attempt to show a wait... 601 // an attempt to show a wait...
602 // more logic should be used, but this will be fine for the moment... 602 // more logic should be used, but this will be fine for the moment...
603 QCopEnvelope ( "QPE/System", "busy()" ); 603 QCopEnvelope ( "QPE/System", "busy()" );
604#endif 604#endif
605 605
606#ifdef HAVE_QUICKEXEC 606#ifdef HAVE_QUICKEXEC
607#ifdef Q_OS_MACX
608 QString libexe = qpeDir()+"/binlib/lib"+args[0] + ".dylib";
609#else
607 QString libexe = qpeDir()+"/binlib/lib"+args[0] + ".so"; 610 QString libexe = qpeDir()+"/binlib/lib"+args[0] + ".so";
611#endif
608 qDebug("libfile = %s", libexe.latin1() ); 612 qDebug("libfile = %s", libexe.latin1() );
609 if ( QFile::exists( libexe ) ) { 613 if ( QFile::exists( libexe ) ) {
610 qDebug("calling quickexec %s", libexe.latin1() ); 614 qDebug("calling quickexec %s", libexe.latin1() );
611 quickexecv( libexe.utf8().data(), (const char **)args ); 615 quickexecv( libexe.utf8().data(), (const char **)args );
612 } else 616 } else
613#endif 617#endif
614 { 618 {
615 bool success = false; 619 bool success = false;
616 int pfd [2]; 620 int pfd [2];
617 if ( ::pipe ( pfd ) < 0 ) 621 if ( ::pipe ( pfd ) < 0 )
618 pfd [0] = pfd [1] = -1; 622 pfd [0] = pfd [1] = -1;
619 623
620 pid_t pid = ::fork ( ); 624 pid_t pid = ::fork ( );
621 625
622 if ( pid == 0 ) { // child 626 if ( pid == 0 ) { // child
623 for ( int fd = 3; fd < 100; fd++ ) { 627 for ( int fd = 3; fd < 100; fd++ ) {
624 if ( fd != pfd [1] ) 628 if ( fd != pfd [1] )
625 ::close ( fd ); 629 ::close ( fd );
626 } 630 }
627 ::setpgid ( ::getpid ( ), ::getppid ( )); 631 ::setpgid ( ::getpid ( ), ::getppid ( ));
628 632
629 // Closing of fd[1] indicates that the execvp succeeded! 633 // Closing of fd[1] indicates that the execvp succeeded!
630 if ( pfd [1] >= 0 ) 634 if ( pfd [1] >= 0 )
631 ::fcntl ( pfd [1], F_SETFD, FD_CLOEXEC ); 635 ::fcntl ( pfd [1], F_SETFD, FD_CLOEXEC );