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

2016-02-16 Thread Henry Castro
 loolwsd/LOOLBroker.cpp |2 +-
 loolwsd/LOOLWSD.cpp|2 +-
 loolwsd/Util.cpp   |   12 
 loolwsd/Util.hpp   |3 +++
 4 files changed, 17 insertions(+), 2 deletions(-)

New commits:
commit a607159a8aa40ca6de4243ce19685b35233f69f2
Author: Henry Castro 
Date:   Tue Feb 16 17:25:51 2016 -0400

loolwsd: catch exception requestTermination

diff --git a/loolwsd/LOOLBroker.cpp b/loolwsd/LOOLBroker.cpp
index b29b4a9..9561be9 100644
--- a/loolwsd/LOOLBroker.cpp
+++ b/loolwsd/LOOLBroker.cpp
@@ -912,7 +912,7 @@ int main(int argc, char** argv)
 for (auto& it : _childProcesses)
 {
 Log::info("Requesting child process " + std::to_string(it.first) + " 
to terminate.");
-Process::requestTermination(it.first);
+Util::requestTermination(it.first);
 }
 
 // Wait and kill child processes
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 8d4cff1..b7cb356 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -1088,7 +1088,7 @@ int LOOLWSD::main(const std::vector& 
/*args*/)
 // Terminate child processes
 Util::writeFIFO(LOOLWSD::BrokerWritePipe, "eof\r\n");
 Log::info("Requesting child process " + std::to_string(pidBroker) + " to 
terminate");
-Process::requestTermination(pidBroker);
+Util::requestTermination(pidBroker);
 
 // wait broker process finish
 waitpid(pidBroker, &status, WUNTRACED);
diff --git a/loolwsd/Util.cpp b/loolwsd/Util.cpp
index 1685d38..697c1b5 100644
--- a/loolwsd/Util.cpp
+++ b/loolwsd/Util.cpp
@@ -543,6 +543,18 @@ namespace Util
 
 return nRetVal;
 }
+
+void requestTermination(const Poco::Process::PID& aPID)
+{
+try
+{
+Poco::Process::requestTermination(aPID);
+}
+catch(const Poco::Exception& exc)
+{
+Log::warn("Exception: " + exc.message());
+}
+}
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/loolwsd/Util.hpp b/loolwsd/Util.hpp
index b6f6f08..4a72945 100644
--- a/loolwsd/Util.hpp
+++ b/loolwsd/Util.hpp
@@ -17,6 +17,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -119,6 +120,8 @@ namespace Util
 
 int getChildStatus(const int nCode);
 int getSignalStatus(const int nCode);
+
+void requestTermination(const Poco::Process::PID& aPID);
 };
 
 //TODO: Move to own file.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-02-03 Thread Henry Castro
 loolwsd/LOOLBroker.cpp |6 --
 loolwsd/LOOLWSD.cpp|6 --
 loolwsd/Util.cpp   |2 ++
 3 files changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 70ff592624f69c9c3804022bd6cb527f3b8022c3
Author: Henry Castro 
Date:   Wed Feb 3 18:08:16 2016 -0400

loolwsd: use strsignal

diff --git a/loolwsd/LOOLBroker.cpp b/loolwsd/LOOLBroker.cpp
index a9af6cd..5776ab9 100644
--- a/loolwsd/LOOLBroker.cpp
+++ b/loolwsd/LOOLBroker.cpp
@@ -970,7 +970,8 @@ int main(int argc, char** argv)
 #endif
 Log::error() << "Child process [" << pid << "] " << fate
  << " with " << Util::signalName(WTERMSIG(status))
- << " signal. " << Log::end;
+ << " signal: " << strsignal(WTERMSIG(status))
+ << Log::end;
 
 removeChild(pid);
 }
@@ -978,7 +979,8 @@ int main(int argc, char** argv)
 {
 Log::info() << "Child process [" << pid << "] stopped with "
 << Util::signalName(WSTOPSIG(status))
-<< " signal. " << Log::end;
+<< " signal: " << strsignal(WTERMSIG(status))
+<< Log::end;
 }
 else if (WIFCONTINUED(status))
 {
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index f382758..eeb3d2d 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -1022,7 +1022,8 @@ int LOOLWSD::main(const std::vector& 
/*args*/)
 #endif
 Log::error() << "Child process [" << pid << "] " << fate
  << " with " << 
Util::signalName(WTERMSIG(status))
- << " signal. " << Log::end;
+ << " signal: " << strsignal(WTERMSIG(status))
+ << Log::end;
 
 break;
 }
@@ -1030,7 +1031,8 @@ int LOOLWSD::main(const std::vector& 
/*args*/)
 {
 Log::info() << "Child process [" << pid << "] stopped with 
"
 << Util::signalName(WSTOPSIG(status))
-<< " signal. " << Log::end;
+<< " signal: " << strsignal(WTERMSIG(status))
+<< Log::end;
 }
 else if (WIFCONTINUED(status))
 {
diff --git a/loolwsd/Util.cpp b/loolwsd/Util.cpp
index a764ff4..e4ae391 100644
--- a/loolwsd/Util.cpp
+++ b/loolwsd/Util.cpp
@@ -427,6 +427,7 @@ namespace Util
 TerminationState = ( aSignal == SIGTERM ? LOOLState::LOOL_ABNORMAL 
: LOOLState::LOOL_STOPPING );
 
 Log::info() << "Termination signal received: "
+<< Util::signalName(aSignal) << " "
 << strsignal(aSignal) << Log::end;
 }
 }
@@ -451,6 +452,7 @@ namespace Util
 void handleFatalSignal(const int aSignal)
 {
 Log::error() << "Fatal signal received: "
+ << Util::signalName(aSignal) << " "
  << strsignal(aSignal) << Log::end;
 
 if (getenv("LOOL_DEBUG"))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits