|
|
@ -40,7 +40,7 @@ static void sig_handler(int sig_num)
|
|
|
|
// No recursion
|
|
|
|
// No recursion
|
|
|
|
signal( SIGHUP, SIG_IGN);
|
|
|
|
signal( SIGHUP, SIG_IGN);
|
|
|
|
signal( SIGTERM, SIG_IGN);
|
|
|
|
signal( SIGTERM, SIG_IGN);
|
|
|
|
fprintf(stderr, "klauncher: Exiting on signal %d\n", sig_num);
|
|
|
|
fprintf(stderr, "[klauncher] Exiting on signal %d\n", sig_num);
|
|
|
|
KLauncher::destruct(255);
|
|
|
|
KLauncher::destruct(255);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -55,8 +55,8 @@ extern "C" KDE_EXPORT int kdemain( int argc, char**argv )
|
|
|
|
// Started via kdeinit.
|
|
|
|
// Started via kdeinit.
|
|
|
|
if (fcntl(LAUNCHER_FD, F_GETFD) == -1)
|
|
|
|
if (fcntl(LAUNCHER_FD, F_GETFD) == -1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fprintf(stderr, "%s", i18n("klauncher: This program is not supposed to be started manually.\n"
|
|
|
|
fprintf(stderr, "%s", i18n("[klauncher] This program is not supposed to be started manually.\n"
|
|
|
|
"klauncher: It is started automatically by kdeinit.\n").local8Bit().data());
|
|
|
|
"[klauncher] It is started automatically by kdeinit.\n").local8Bit().data());
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -82,7 +82,7 @@ extern "C" KDE_EXPORT int kdemain( int argc, char**argv )
|
|
|
|
TQCString dcopName = KApplication::dcopClient()->registerAs(name, false);
|
|
|
|
TQCString dcopName = KApplication::dcopClient()->registerAs(name, false);
|
|
|
|
if (dcopName.isEmpty())
|
|
|
|
if (dcopName.isEmpty())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
kdWarning() << "DCOP communication problem!" << endl;
|
|
|
|
kdWarning() << "[klauncher] DCOP communication problem!" << endl;
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (dcopName == cname)
|
|
|
|
if (dcopName == cname)
|
|
|
@ -90,12 +90,12 @@ extern "C" KDE_EXPORT int kdemain( int argc, char**argv )
|
|
|
|
|
|
|
|
|
|
|
|
if (--maxTry == 0)
|
|
|
|
if (--maxTry == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
kdWarning() << "Another instance of klauncher is already running!" << endl;
|
|
|
|
kdWarning() << "[klauncher] Another instance of klauncher is already running!" << endl;
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Wait a bit...
|
|
|
|
// Wait a bit...
|
|
|
|
kdWarning() << "Waiting for already running klauncher to exit." << endl;
|
|
|
|
kdWarning() << "[klauncher] Waiting for already running klauncher to exit." << endl;
|
|
|
|
sleep(1);
|
|
|
|
sleep(1);
|
|
|
|
|
|
|
|
|
|
|
|
// Try again...
|
|
|
|
// Try again...
|
|
|
|