mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-15 10:30:40 +01:00
Merge pull request #6069 from alorbach/macos-fix-buildissues
runtime: fix Darwin build regressions
This commit is contained in:
commit
508a40ebb0
@ -776,7 +776,6 @@ static rsRetVal cslchCallHdlr(cslCmdHdlr_t *pThis, uchar **ppConfLine) {
|
||||
goto finalize_it;
|
||||
}
|
||||
|
||||
|
||||
finalize_it:
|
||||
RETiRet;
|
||||
}
|
||||
|
||||
@ -1322,10 +1322,28 @@ static void ATTR_NONNULL() * wrkr(void *arg) {
|
||||
DBGPRINTF("prctl failed, not setting thread name for '%s'\n", thrdName);
|
||||
}
|
||||
#elif defined(HAVE_PTHREAD_SETNAME_NP)
|
||||
#if defined(__APPLE__)
|
||||
/* The macOS variant takes only the thread name and returns an int. */
|
||||
int r = pthread_setname_np((char *)shortThrdName);
|
||||
if (r != 0) {
|
||||
DBGPRINTF("pthread_setname_np failed, not setting thread name for '%s'\n", shortThrdName);
|
||||
}
|
||||
#elif defined(__FreeBSD__)
|
||||
/* FreeBSD variant has a void return type. */
|
||||
pthread_setname_np(pthread_self(), (char *)shortThrdName);
|
||||
#elif defined(__NetBSD__)
|
||||
/* NetBSD variant takes a format string and returns an int. */
|
||||
int r = pthread_setname_np(pthread_self(), "%s", (void *)shortThrdName);
|
||||
if (r != 0) {
|
||||
DBGPRINTF("pthread_setname_np failed, not setting thread name for '%s'\n", shortThrdName);
|
||||
}
|
||||
#else
|
||||
/* The glibc variant takes thread ID and name, and returns an int. */
|
||||
int r = pthread_setname_np(pthread_self(), (char *)shortThrdName);
|
||||
if (r != 0) {
|
||||
DBGPRINTF("pthread_setname_np failed, not setting thread name for '%s'\n", thrdName);
|
||||
DBGPRINTF("pthread_setname_np failed, not setting thread name for '%s'\n", shortThrdName);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if ((localRet = statsobj.Construct(&wrkrData->stats)) == RS_RET_OK) {
|
||||
|
||||
@ -72,6 +72,9 @@
|
||||
#ifdef HAVE_PATHS_H
|
||||
#include <paths.h>
|
||||
#endif
|
||||
#ifndef _PATH_UTMP
|
||||
#define _PATH_UTMP "/var/run/utmp"
|
||||
#endif
|
||||
#ifdef HAVE_LIBSYSTEMD
|
||||
#include <systemd/sd-daemon.h>
|
||||
#include <systemd/sd-login.h>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user