Changes: Some comments made clearer / added.

RevBy: TrustMe
pull/1/head
Jussi Lind 15 years ago
parent 319b9d9af3
commit 706672a85f

@ -157,15 +157,17 @@ void Booster::run()
{ {
if (!m_appData->fileName().empty()) if (!m_appData->fileName().empty())
{ {
//check if can close sockets here // Check if can close sockets already here
if (!m_connection->isReportAppExitStatusNeeded()) if (!m_connection->isReportAppExitStatusNeeded())
{ {
Connection::closeAllSockets(); Connection::closeAllSockets();
} }
// Execute the binary
Logger::logInfo("Booster: invoking '%s' ", m_appData->fileName().c_str()); Logger::logInfo("Booster: invoking '%s' ", m_appData->fileName().c_str());
int ret_val = launchProcess(); int ret_val = launchProcess();
// Send exit status to invoker, if needed
if (m_connection->isReportAppExitStatusNeeded()) if (m_connection->isReportAppExitStatusNeeded())
{ {
m_connection->sendAppExitStatus(ret_val); m_connection->sendAppExitStatus(ret_val);

@ -244,9 +244,7 @@ void Daemon::forkBooster(char type, int sleepTime)
// Set session id // Set session id
if (setsid() < 0) if (setsid() < 0)
{ Logger::logError("Daemon: Couldn't set session id\n");
Logger::logError("Daemon: Setting session id\n");
}
// Guarantee some time for the just launched application to // Guarantee some time for the just launched application to
// start up before forking new booster if needed. // start up before forking new booster if needed.
@ -259,6 +257,7 @@ void Daemon::forkBooster(char type, int sleepTime)
Booster * booster = BoosterFactory::create(type); Booster * booster = BoosterFactory::create(type);
if (booster) if (booster)
{ {
// Initialize and wait for commands from invoker
booster->initialize(m_initialArgc, m_initialArgv, m_pipefd); booster->initialize(m_initialArgc, m_initialArgv, m_pipefd);
// Run the current Booster // Run the current Booster
@ -267,7 +266,8 @@ void Daemon::forkBooster(char type, int sleepTime)
// Finish // Finish
delete booster; delete booster;
// avoid situation when destructors for static objects may be run incorrectly // _exit() instead of exit() to avoid situation when destructors
// for static objects may be run incorrectly
_exit(EXIT_SUCCESS); _exit(EXIT_SUCCESS);
} }
else else

Loading…
Cancel
Save