Merge branch 'musl' into 'master'

Fix Musl incompabilities

See merge request mer-core/mapplauncherd!16
pull/1/head
pvuorela 5 years ago
commit 4fd919ca0e

@ -26,7 +26,6 @@
#include <string.h>
#include <signal.h>
#include <sys/socket.h>
#include <bits/socket.h>
#include <sys/un.h>
#include <sys/uio.h>
#include <sys/time.h>

@ -46,6 +46,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <grp.h>
#include <libgen.h>
#include "coverage.h"
@ -328,9 +329,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);
}
}
@ -508,7 +512,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

@ -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];

Loading…
Cancel
Save