mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-18 20:20:41 +01:00
Merge branch 'beta'
Conflicts: runtime/wti.c runtime/wtp.c
This commit is contained in:
commit
511fd780a2
@ -63,7 +63,7 @@ AC_SUBST(DL_LIBS)
|
|||||||
AC_HEADER_RESOLV
|
AC_HEADER_RESOLV
|
||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
AC_HEADER_SYS_WAIT
|
AC_HEADER_SYS_WAIT
|
||||||
AC_CHECK_HEADERS([arpa/inet.h libgen.h fcntl.h locale.h netdb.h netinet/in.h paths.h stddef.h stdlib.h string.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h sys/stat.h syslog.h unistd.h utmp.h sys/epoll.h])
|
AC_CHECK_HEADERS([arpa/inet.h libgen.h fcntl.h locale.h netdb.h netinet/in.h paths.h stddef.h stdlib.h string.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h sys/stat.h syslog.h unistd.h utmp.h sys/epoll.h sys/prctl.h])
|
||||||
|
|
||||||
# Checks for typedefs, structures, and compiler characteristics.
|
# Checks for typedefs, structures, and compiler characteristics.
|
||||||
AC_C_CONST
|
AC_C_CONST
|
||||||
@ -98,7 +98,7 @@ AC_TYPE_SIGNAL
|
|||||||
AC_FUNC_STAT
|
AC_FUNC_STAT
|
||||||
AC_FUNC_STRERROR_R
|
AC_FUNC_STRERROR_R
|
||||||
AC_FUNC_VPRINTF
|
AC_FUNC_VPRINTF
|
||||||
AC_CHECK_FUNCS([flock basename alarm clock_gettime gethostbyname gethostname gettimeofday localtime_r memset mkdir regcomp select setid socket strcasecmp strchr strdup strerror strndup strnlen strrchr strstr strtol strtoul uname ttyname_r epoll_wait getline malloc_trim])
|
AC_CHECK_FUNCS([flock basename alarm clock_gettime gethostbyname gethostname gettimeofday localtime_r memset mkdir regcomp select setid socket strcasecmp strchr strdup strerror strndup strnlen strrchr strstr strtol strtoul uname ttyname_r epoll_wait getline malloc_trim prctl])
|
||||||
|
|
||||||
# Check for MAXHOSTNAMELEN
|
# Check for MAXHOSTNAMELEN
|
||||||
AC_MSG_CHECKING(for MAXHOSTNAMELEN)
|
AC_MSG_CHECKING(for MAXHOSTNAMELEN)
|
||||||
|
|||||||
@ -48,7 +48,9 @@
|
|||||||
#include "stream.h"
|
#include "stream.h"
|
||||||
#include "unicode-helper.h"
|
#include "unicode-helper.h"
|
||||||
#include "module-template.h"
|
#include "module-template.h"
|
||||||
#include <sys/prctl.h>
|
#if HAVE_SYS_PRCTL_H
|
||||||
|
# include <sys/prctl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define inline
|
#define inline
|
||||||
|
|
||||||
@ -891,9 +893,11 @@ asyncWriterThread(void *pPtr)
|
|||||||
ISOBJ_TYPE_assert(pThis, strm);
|
ISOBJ_TYPE_assert(pThis, strm);
|
||||||
|
|
||||||
BEGINfunc
|
BEGINfunc
|
||||||
|
# if HAVE_PRCTL && defined PR_SET_NAME
|
||||||
if(prctl(PR_SET_NAME, "rs:asyn strmwr", 0, 0, 0) != 0) {
|
if(prctl(PR_SET_NAME, "rs:asyn strmwr", 0, 0, 0) != 0) {
|
||||||
DBGPRINTF("prctl failed, not setting thread name for '%s'\n", "stream writer");
|
DBGPRINTF("prctl failed, not setting thread name for '%s'\n", "stream writer");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
while(1) { /* loop broken inside */
|
while(1) { /* loop broken inside */
|
||||||
d_pthread_mutex_lock(&pThis->mut);
|
d_pthread_mutex_lock(&pThis->mut);
|
||||||
@ -904,7 +908,6 @@ asyncWriterThread(void *pPtr)
|
|||||||
goto finalize_it; /* break main loop */
|
goto finalize_it; /* break main loop */
|
||||||
}
|
}
|
||||||
if(bTimedOut && pThis->iBufPtr > 0) {
|
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 */
|
/* if we timed out, we need to flush pending data */
|
||||||
strmFlush(pThis);
|
strmFlush(pThis);
|
||||||
bTimedOut = 0;
|
bTimedOut = 0;
|
||||||
|
|||||||
@ -40,7 +40,9 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <atomic.h>
|
#include <atomic.h>
|
||||||
#include <sys/prctl.h>
|
#if HAVE_SYS_PRCTL_H
|
||||||
|
# include <sys/prctl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/// TODO: check on solaris if this is any longer needed - I don't think so - rgerhards, 2009-09-20
|
/// TODO: check on solaris if this is any longer needed - I don't think so - rgerhards, 2009-09-20
|
||||||
//#ifdef OS_SOLARIS
|
//#ifdef OS_SOLARIS
|
||||||
@ -355,12 +357,14 @@ wtpWorker(void *arg) /* the arg is actually a wti object, even though we are in
|
|||||||
sigfillset(&sigSet);
|
sigfillset(&sigSet);
|
||||||
pthread_sigmask(SIG_BLOCK, &sigSet, NULL);
|
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... */
|
/* set thread name - we ignore if the call fails, has no harsh consequences... */
|
||||||
pszDbgHdr = wtpGetDbgHdr(pThis);
|
pszDbgHdr = wtpGetDbgHdr(pThis);
|
||||||
ustrncpy(thrdName+3, pszDbgHdr, 20);
|
ustrncpy(thrdName+3, pszDbgHdr, 20);
|
||||||
if(prctl(PR_SET_NAME, thrdName, 0, 0, 0) != 0) {
|
if(prctl(PR_SET_NAME, thrdName, 0, 0, 0) != 0) {
|
||||||
DBGPRINTF("prctl failed, not setting thread name for '%s'\n", wtpGetDbgHdr(pThis));
|
DBGPRINTF("prctl failed, not setting thread name for '%s'\n", wtpGetDbgHdr(pThis));
|
||||||
}
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
BEGIN_MTX_PROTECTED_OPERATIONS(&pThis->mut, LOCK_MUTEX);
|
BEGIN_MTX_PROTECTED_OPERATIONS(&pThis->mut, LOCK_MUTEX);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user