Changes: Comments in booster.h / booster.cpp improved. One useless

method declaration removed.
pull/1/head
Jussi Lind 15 years ago
parent e78012ffdb
commit 0195e8b9b3

@ -228,15 +228,18 @@ void* Booster::loadMain()
void * module = dlopen(m_app.fileName().c_str(), RTLD_LAZY | RTLD_GLOBAL); void * module = dlopen(m_app.fileName().c_str(), RTLD_LAZY | RTLD_GLOBAL);
if (!module) if (!module)
Logger::logErrorAndDie(EXIT_FAILURE, "Booster: loading invoked application: '%s'\n", dlerror()); Logger::logErrorAndDie(EXIT_FAILURE, "Booster: Loading invoked application failed: '%s'\n", dlerror());
// Find out the address for symbol "main". dlerror() is first used to clear any old error conditions,
// then dlsym() is called, and then dlerror() is checked again. This procedure is documented
// in dlsym()'s man page.
// Find out the address for symbol "main".
dlerror(); dlerror();
m_app.setEntry(reinterpret_cast<entry_t>(dlsym(module, "main"))); m_app.setEntry(reinterpret_cast<entry_t>(dlsym(module, "main")));
const char * error_s = dlerror(); const char * error_s = dlerror();
if (error_s != NULL) if (error_s != NULL)
Logger::logErrorAndDie(EXIT_FAILURE, "Booster: loading symbol 'main': '%s'\n", error_s); Logger::logErrorAndDie(EXIT_FAILURE, "Booster: Loading symbol 'main' failed: '%s'\n", error_s);
return module; return module;
} }

@ -125,16 +125,26 @@ private:
//! Disable assignment operator //! Disable assignment operator
Booster & operator= (const Booster & r); Booster & operator= (const Booster & r);
//! Load the library and jump to main
int launchProcess();
void complainAndExit(); //! Helper method: load the library and find out address for "main".
int launchProcess();
void* loadMain(); void* loadMain();
//! Data structure representing the application to be invoked
AppData m_app; AppData m_app;
//! Socket connection to invoker
Connection* m_conn; Connection* m_conn;
//! Size (length) of the argument vector
int m_argvArraySize; int m_argvArraySize;
//! Process priority before pushPriority() is called
int m_oldPriority; int m_oldPriority;
//! True if m_oldPriority is a valid value so that
//! it can be restored later.
bool m_oldPriorityOk; bool m_oldPriorityOk;
#ifdef UNIT_TEST #ifdef UNIT_TEST

Loading…
Cancel
Save