diff --git a/src/invoker/invoker.c b/src/invoker/invoker.c index ba81f7b..1a806d9 100644 --- a/src/invoker/invoker.c +++ b/src/invoker/invoker.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/src/launcherlib/booster.cpp b/src/launcherlib/booster.cpp index 235f2a0..3495503 100644 --- a/src/launcherlib/booster.cpp +++ b/src/launcherlib/booster.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include "coverage.h" @@ -327,9 +328,12 @@ void Booster::renameProcess(int parentArgc, char** parentArgv, } // Set the process name using prctl, 'killall' and 'top' use it - if ( prctl(PR_SET_NAME, basename(sourceArgv[0])) == -1 ) + char* processName = strdup(sourceArgv[0]); + if ( prctl(PR_SET_NAME, basename(processName)) == -1 ) Logger::logError("Booster: on set new process name: %s ", strerror(errno)); + std::free(processName); + setenv("_", sourceArgv[0], true); } } @@ -583,7 +587,7 @@ void* Booster::loadMain() else dlopenFlags |= RTLD_LOCAL; -#if (PLATFORM_ID == Linux) +#if (PLATFORM_ID == Linux) && defined(__GLIBC__) if (m_appData->dlopenDeep()) dlopenFlags |= RTLD_DEEPBIND; #endif diff --git a/src/launcherlib/connection.cpp b/src/launcherlib/connection.cpp index b5dd89d..71bd405 100644 --- a/src/launcherlib/connection.cpp +++ b/src/launcherlib/connection.cpp @@ -281,8 +281,8 @@ bool Connection::receiveArgs() { // Get argc recvMsg(&m_argc); - const uint32_t ARG_MAX = 1024; - if (m_argc > 0 && m_argc < ARG_MAX) + const uint32_t argMax = 1024; + if (m_argc > 0 && m_argc < argMax) { // Reserve memory for argv m_argv = new const char * [m_argc];