[Libreoffice-commits] online.git: loolwsd/LOOLBroker.cpp loolwsd/Util.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Sun Jan 3 07:19:30 PST 2016


 loolwsd/LOOLBroker.cpp |    2 +-
 loolwsd/Util.cpp       |    9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 1746094fcd2e8356d1da68d237eac51da3bbfcc1
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Wed Dec 30 11:41:41 2015 -0500

    loolwsd: log the thread name where available
    
    Change-Id: If40b2d3a72f3e00e8c3bf27fe60c6d63a71df267
    Reviewed-on: https://gerrit.libreoffice.org/21062
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loolwsd/LOOLBroker.cpp b/loolwsd/LOOLBroker.cpp
index 71e4d28..31c114b 100644
--- a/loolwsd/LOOLBroker.cpp
+++ b/loolwsd/LOOLBroker.cpp
@@ -393,7 +393,7 @@ public:
                 else
                 if (aPoll.revents & (POLLERR | POLLHUP))
                 {
-                    Log::error("Broken pipe [" + FIFO_FILE + "] with broker.");
+                    Log::error("Broken pipe [" + FIFO_FILE + "] with wsd.");
                     break;
                 }
             }
diff --git a/loolwsd/Util.cpp b/loolwsd/Util.cpp
index 62883c2..81e3b7d 100644
--- a/loolwsd/Util.cpp
+++ b/loolwsd/Util.cpp
@@ -8,6 +8,9 @@
  */
 
 #include <sys/poll.h>
+#ifdef __linux
+#include <sys/prctl.h>
+#endif
 
 #include <cstdlib>
 #include <cstring>
@@ -96,6 +99,12 @@ namespace Log
                << std::setw(2) << seconds << "." << std::setw(6) << usec
                << ", ";
 
+#ifdef __linux
+        char buf[32]; // we really need only 16
+        if (prctl(PR_GET_NAME, reinterpret_cast<unsigned long>(buf), 0, 0, 0) == 0)
+            stream << '[' << buf << "] ";
+#endif
+
         return stream.str();
     }
 


More information about the Libreoffice-commits mailing list