summaryrefslogtreecommitdiffstats
path: root/runtime/debug.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-04-21 16:54:05 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-04-21 16:54:05 +0200
commit88caccecf8dd8beaf46915df05241a44f7d635f6 (patch)
tree7d6db5808b3bdd2453f041fef5c808b8fab36119 /runtime/debug.c
parent6e410a76f64d74fec03de27a6ca1f3f996844917 (diff)
parent8e536c5b25ca1a7106f541149cf0d76bdf9237da (diff)
downloadrsyslog-88caccecf8dd8beaf46915df05241a44f7d635f6.tar.gz
rsyslog-88caccecf8dd8beaf46915df05241a44f7d635f6.tar.xz
rsyslog-88caccecf8dd8beaf46915df05241a44f7d635f6.zip
Merge branch 'master' into beta
Conflicts: ChangeLog configure.ac doc/manual.html
Diffstat (limited to 'runtime/debug.c')
-rw-r--r--runtime/debug.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/runtime/debug.c b/runtime/debug.c
index 62e2a687..4ee90226 100644
--- a/runtime/debug.c
+++ b/runtime/debug.c
@@ -1,3 +1,4 @@
+#include <sys/syscall.h>
/* debug.c
*
* This file proides debug and run time error analysis support. Some of the
@@ -886,7 +887,9 @@ dbgprint(obj_t *pObj, char *pszMsg, size_t lenMsg)
if(stddbg != -1) write(stddbg, pszWriteBuf, lenWriteBuf);
if(altdbg != -1) write(altdbg, pszWriteBuf, lenWriteBuf);
}
+
lenWriteBuf = snprintf(pszWriteBuf, sizeof(pszWriteBuf), "%s: ", pszThrdName);
+ // use for testing: lenWriteBuf = snprintf(pszWriteBuf, sizeof(pszWriteBuf), "{%ld}%s: ", (long) syscall(SYS_gettid), pszThrdName);
if(stddbg != -1) write(stddbg, pszWriteBuf, lenWriteBuf);
if(altdbg != -1) write(altdbg, pszWriteBuf, lenWriteBuf);
/* print object name header if we have an object */
@@ -1340,7 +1343,7 @@ rsRetVal dbgClassInit(void)
if(pszAltDbgFileName != NULL) {
/* we have a secondary file, so let's open it) */
- if((altdbg = open(pszAltDbgFileName, O_WRONLY|O_CREAT|O_TRUNC|O_NOCTTY, S_IRUSR|S_IWUSR)) == -1) {
+ if((altdbg = open(pszAltDbgFileName, O_WRONLY|O_CREAT|O_TRUNC|O_NOCTTY|O_CLOEXEC, S_IRUSR|S_IWUSR)) == -1) {
fprintf(stderr, "alternate debug file could not be opened, ignoring. Error: %s\n", strerror(errno));
}
}