mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-08-03 09:48:00 -04:00
25 lines
724 B
Plaintext
25 lines
724 B
Plaintext
$NetBSD: patch-src_zm_logger_cpp,v 1.3 2013/04/29 21:31:13 joerg Exp $
|
|
|
|
If the system has syscall() but not SYS_gettid [E.g. NetBSD], don't attempt
|
|
to use SYS_gettid.
|
|
|
|
--- src/zm_logger.cpp.orig 2011-06-28 11:07:35.000000000 +0000
|
|
+++ src/zm_logger.cpp
|
|
@@ -33,6 +33,7 @@
|
|
#include <signal.h>
|
|
#include <stdarg.h>
|
|
#include <errno.h>
|
|
+#include <unistd.h>
|
|
|
|
bool Logger::smInitialised = false;
|
|
Logger *Logger::smInstance = 0;
|
|
@@ -515,7 +516,7 @@ void Logger::logPrint( bool hex, const c
|
|
#endif
|
|
|
|
pid_t tid;
|
|
-#ifdef HAVE_SYSCALL
|
|
+#if defined(HAVE_SYSCALL) && defined(SYS_gettid)
|
|
if ( (tid = syscall(SYS_gettid)) < 0 ) // Thread/Process id
|
|
#endif // HAVE_SYSCALL
|
|
tid = getpid(); // Process id
|