loolwsd/LOOLBroker.cpp |   17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

New commits:
commit 7f7453cd7f3a2b0c2597d4a0506acfc588d1fe6a
Author: Henry Castro <hcas...@collabora.com>
Date:   Sun Sep 27 17:25:52 2015 -0400

    loolwsd: change startupLibreOfficeKit to report error status

diff --git a/loolwsd/LOOLBroker.cpp b/loolwsd/LOOLBroker.cpp
index 1eec9fa..1c52500 100644
--- a/loolwsd/LOOLBroker.cpp
+++ b/loolwsd/LOOLBroker.cpp
@@ -302,14 +302,21 @@ static int createLibreOfficeKit(bool sharePages, 
std::string loSubPath, Poco::UI
     return child;
 }
 
-static void startupLibreOfficeKit(bool sharePages, int nLOKits,
+static int startupLibreOfficeKit(bool sharePages, int nLOKits,
                                   std::string loSubPath, Poco::UInt64 child)
 {
+    Process::PID pId = -1;
+
     for (int nCntr = nLOKits; nCntr; nCntr--)
     {
-        if (createLibreOfficeKit(sharePages, loSubPath, child) < 0)
+        if ( (pId = createLibreOfficeKit(sharePages, loSubPath, child)) < 0)
+        {
+            std::cout << Util::logPrefix() << "startupLibreOfficeKit: " << 
strerror(errno) << std::endl;
             break;
+        }
     }
+
+   return pId;
 }
 
 static int timeoutCounter = 0;
@@ -461,7 +468,11 @@ int main(int argc, char** argv)
 
     bool sharePages = globalPreinit(loSubPath);
 
-    startupLibreOfficeKit(sharePages, _numPreSpawnedChildren, loSubPath, 
_childId);
+    if ( startupLibreOfficeKit(sharePages, _numPreSpawnedChildren, loSubPath, 
_childId) < 0 )
+    {
+        std::cout << Util::logPrefix() << "fail to create childs: " << 
strerror(errno) << std::endl;
+        exit(-1);
+    }
 
     while (_childProcesses.size() > 0)
     {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to