use thread ID instead of process ID in logger messages (issue #5349)
[asterisk/asterisk.git] / logger.c
index 4e476b2..987d52b 100755 (executable)
--- a/logger.c
+++ b/logger.c
@@ -65,13 +65,17 @@ static int syslog_level_map[] = {
 
 #define MAX_MSG_QUEUE 200
 
-#if defined(__linux__) && defined(__NR_gettid)
+#if defined(__linux__) && !defined(__NR_gettid)
 #include <asm/unistd.h>
+#endif
+
+#if defined(__linux__) && defined(__NR_gettid)
 #define GETTID() syscall(__NR_gettid)
 #else
 #define GETTID() getpid()
 #endif
 
+
 static char dateformat[256] = "%b %e %T";              /* Original Asterisk Format */
 
 AST_MUTEX_DEFINE_STATIC(msglist_lock);