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

Ashod Nakashian ashod.nakashian at collabora.co.uk
Wed Jan 6 21:55:02 PST 2016


 loolwsd/LOOLWSD.cpp |   19 +++++++------------
 loolwsd/LOOLWSD.hpp |    3 +--
 2 files changed, 8 insertions(+), 14 deletions(-)

New commits:
commit b0cd3e5a460336ef72f3b9236ab187b4fe5459e2
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Wed Jan 6 22:17:30 2016 -0500

    loolwsd: spawn one broker and one only
    
    Change-Id: I9ec23e7e9e9672e5e4e6d55b7a79e6db1f617e45
    Reviewed-on: https://gerrit.libreoffice.org/21181
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 9b5276b..81d1712 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -786,7 +786,7 @@ void LOOLWSD::displayHelp()
     helpFormatter.format(std::cout);
 }
 
-int LOOLWSD::createBroker()
+bool LOOLWSD::createBroker()
 {
     Process::Args args;
 
@@ -809,16 +809,7 @@ int LOOLWSD::createBroker()
     Log::info() << "Adding Broker #" << childIndex << " PID " << child.id() << Log::end;
     MasterProcessSession::_childProcesses[child.id()] = child.id();
 
-    return Application::EXIT_OK;
-}
-
-void LOOLWSD::startupBroker(const signed nBrokers)
-{
-    for (signed nCntr = nBrokers; nCntr > 0; --nCntr)
-    {
-        if (createBroker() < 0)
-            break;
-    }
+    return true;
 }
 
 int LOOLWSD::main(const std::vector<std::string>& /*args*/)
@@ -878,7 +869,11 @@ int LOOLWSD::main(const std::vector<std::string>& /*args*/)
 
     NamedMutexLOOL.lock();
 
-    startupBroker(1);
+    if (!createBroker())
+    {
+        Log::error("Failed to spawn loolBroker.");
+        return Application::EXIT_UNAVAILABLE;
+    }
 
 #ifdef __linux
     dropCapability(CAP_SYS_CHROOT);
diff --git a/loolwsd/LOOLWSD.hpp b/loolwsd/LOOLWSD.hpp
index 907620a..f03faed 100644
--- a/loolwsd/LOOLWSD.hpp
+++ b/loolwsd/LOOLWSD.hpp
@@ -74,8 +74,7 @@ private:
     int  createComponent();
     int  createDesktop();
 
-    void startupBroker(int nBroker);
-    int  createBroker();
+    bool createBroker();
 };
 
 #endif


More information about the Libreoffice-commits mailing list