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

Tor Lillqvist tml at collabora.com
Fri Apr 8 13:08:23 UTC 2016


 loolwsd/Util.cpp |    8 ++++----
 loolwsd/Util.hpp |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 7d82e059a227f6960785ee6a92ebe68b53d0e7b3
Author: Tor Lillqvist <tml at collabora.com>
Date:   Fri Apr 8 16:06:39 2016 +0300

    Make Util::signalName() return a const char *instead
    
    Makes its use in handleTerminationSignal() and handleFatalSignal()
    less complicated.

diff --git a/loolwsd/Util.cpp b/loolwsd/Util.cpp
index 77c8cdb..f60f9a0 100644
--- a/loolwsd/Util.cpp
+++ b/loolwsd/Util.cpp
@@ -303,7 +303,7 @@ namespace Util
         return true;
     }
 
-    std::string signalName(const int signo)
+    const char *signalName(const int signo)
     {
         switch (signo)
         {
@@ -359,7 +359,7 @@ namespace Util
 #endif
 #undef CASE
         default:
-            return std::to_string(signo);
+            return "unknown";
         }
     }
 
@@ -393,7 +393,7 @@ namespace Util
 
             log_signal(LogPrefix);
             log_signal(" Termination signal received: ");
-            log_signal(signalName(signal).c_str());
+            log_signal(signalName(signal));
             log_signal("\n");
         }
     }
@@ -419,7 +419,7 @@ namespace Util
     {
         log_signal(LogPrefix);
         log_signal(" Fatal signal received: ");
-        log_signal(signalName(signal).c_str());
+        log_signal(signalName(signal));
         log_signal("\n");
 
         if (std::getenv("LOOL_DEBUG"))
diff --git a/loolwsd/Util.hpp b/loolwsd/Util.hpp
index 008d02a..09c63bd 100644
--- a/loolwsd/Util.hpp
+++ b/loolwsd/Util.hpp
@@ -113,7 +113,7 @@ namespace Util
     }
 
     /// Returns the name of the signal.
-    std::string signalName(int signo);
+    const char *signalName(int signo);
 
     /// Trap signals to cleanup and exit the process gracefully.
     void setTerminationSignals();


More information about the Libreoffice-commits mailing list