diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/stream.c | 7 | ||||
-rw-r--r-- | runtime/wti.c | 1 | ||||
-rw-r--r-- | runtime/wtp.c | 7 |
3 files changed, 10 insertions, 5 deletions
diff --git a/runtime/stream.c b/runtime/stream.c index a0571a61..605a9771 100644 --- a/runtime/stream.c +++ b/runtime/stream.c @@ -48,7 +48,9 @@ #include "stream.h" #include "unicode-helper.h" #include "module-template.h" -#include <sys/prctl.h> +#if HAVE_SYS_PRCTL_H +# include <sys/prctl.h> +#endif #define inline @@ -891,9 +893,11 @@ asyncWriterThread(void *pPtr) ISOBJ_TYPE_assert(pThis, strm); BEGINfunc +# if HAVE_PRCTL && defined PR_SET_NAME if(prctl(PR_SET_NAME, "rs:asyn strmwr", 0, 0, 0) != 0) { DBGPRINTF("prctl failed, not setting thread name for '%s'\n", "stream writer"); } +#endif while(1) { /* loop broken inside */ d_pthread_mutex_lock(&pThis->mut); @@ -904,7 +908,6 @@ asyncWriterThread(void *pPtr) goto finalize_it; /* break main loop */ } if(bTimedOut && pThis->iBufPtr > 0) { -RUNLOG_STR("XXX: we had a timeout in stream writer"); /* if we timed out, we need to flush pending data */ strmFlush(pThis); bTimedOut = 0; diff --git a/runtime/wti.c b/runtime/wti.c index 156d8116..abdf4add 100644 --- a/runtime/wti.c +++ b/runtime/wti.c @@ -41,7 +41,6 @@ #ifdef OS_SOLARIS # include <sched.h> -# define pthread_yield() sched_yield() #endif #include "rsyslog.h" diff --git a/runtime/wtp.c b/runtime/wtp.c index ba1f94b3..596ff866 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" @@ -437,12 +438,14 @@ 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... */ pszDbgHdr = wtpGetDbgHdr(pThis); ustrncpy(thrdName+3, pszDbgHdr, 20); if(prctl(PR_SET_NAME, thrdName, 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); |