[gnote] Correct thread id printing in debug output



commit 326ec37cd316ae3bbf602a7517a4a37a8ebd2f11
Author: Aurimas Ä?ernius <aurisc4 gmail com>
Date:   Tue May 10 20:52:29 2011 +0300

    Correct thread id printing in debug output
    
    Use %lu specifier and cast to pthread_t.
    This prints the correct thread is on Linux and does not prevent build on *BSD.
    Fixes bug 649478.

 src/debug.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/debug.cpp b/src/debug.cpp
index f5de723..40724ee 100644
--- a/src/debug.cpp
+++ b/src/debug.cpp
@@ -126,7 +126,7 @@ namespace utils {
 //    static boost::recursive_mutex mutex;
 //    boost::recursive_mutex::scoped_lock lock(mutex);
     char buf[128];
-    snprintf(buf, 128, "(%d) ", (int)pthread_self());
+    snprintf(buf, 128, "(%lu) ", (pthread_t)pthread_self());
     fwrite(buf, 1, strlen(buf), stderr);
     fwrite(prefix, 1, strlen(prefix), stderr);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]