summaryrefslogtreecommitdiffstats
path: root/runtime/wtp.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-07-16 12:55:22 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-07-16 12:55:22 +0200
commit191c51187ee54201954e5c73492a8bd5902044c7 (patch)
tree77aeee87379f79827341b9c701223f317378605c /runtime/wtp.c
parentcc8ef1a1546548c5d77b06f0726bf16bba5ad77e (diff)
downloadrsyslog-191c51187ee54201954e5c73492a8bd5902044c7.tar.gz
rsyslog-191c51187ee54201954e5c73492a8bd5902044c7.tar.xz
rsyslog-191c51187ee54201954e5c73492a8bd5902044c7.zip
calls to prctl() need to be based on configure results (cross-platform issue)
Diffstat (limited to 'runtime/wtp.c')
-rw-r--r--runtime/wtp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/runtime/wtp.c b/runtime/wtp.c
index 02662cde..87c3b324 100644
--- a/runtime/wtp.c
+++ b/runtime/wtp.c
@@ -40,11 +40,12 @@
#include <unistd.h>
#include <errno.h>
#include <atomic.h>
-#include <sys/prctl.h>
+#if HAVE_SYS_PRCTL_H
+# include <sys/prctl.h>
+#endif
#ifdef OS_SOLARIS
# include <sched.h>
-# define pthread_yield() sched_yield()
#endif
#include "rsyslog.h"
@@ -434,10 +435,12 @@ wtpWorker(void *arg) /* the arg is actually a wti object, even though we are in
sigfillset(&sigSet);
pthread_sigmask(SIG_BLOCK, &sigSet, NULL);
+# if HAVE_PRCTL && defined PR_SET_NAME
/* set thread name - we ignore if the call fails, has no harsh consequences... */
if(prctl(PR_SET_NAME, wtpGetDbgHdr(pThis), 0, 0, 0) != 0) {
DBGPRINTF("prctl failed, not setting thread name for '%s'\n", wtpGetDbgHdr(pThis));
}
+# endif
BEGIN_MTX_PROTECTED_OPERATIONS(&pThis->mut, LOCK_MUTEX);