[Libreoffice-commits] online.git: 3 commits - loolwsd/LOOLForKit.cpp

Tor Lillqvist tml at collabora.com
Fri Apr 8 10:15:53 UTC 2016


 loolwsd/LOOLForKit.cpp |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

New commits:
commit c08d35dd153a4ad40dd54e3bb47f7d9c26162f94
Author: Tor Lillqvist <tml at collabora.com>
Date:   Fri Apr 8 13:12:21 2016 +0300

    Add comment

diff --git a/loolwsd/LOOLForKit.cpp b/loolwsd/LOOLForKit.cpp
index 14150a9..e6f6c15 100644
--- a/loolwsd/LOOLForKit.cpp
+++ b/loolwsd/LOOLForKit.cpp
@@ -89,6 +89,7 @@ static int createLibreOfficeKit(const std::string& childRoot,
     if (!(pid = fork()))
     {
         // quicker than a generic socket closing approach.
+        // (but pipeFd is a pipe, not a socket...?)
         close(pipeFd);
 
         // child
commit 48bc23f3ceda43b90bd175e27d91db5e0c24a838
Author: Tor Lillqvist <tml at collabora.com>
Date:   Fri Apr 8 13:09:06 2016 +0300

    Drop unnecessary variable

diff --git a/loolwsd/LOOLForKit.cpp b/loolwsd/LOOLForKit.cpp
index ee3b78a..14150a9 100644
--- a/loolwsd/LOOLForKit.cpp
+++ b/loolwsd/LOOLForKit.cpp
@@ -83,8 +83,6 @@ static int createLibreOfficeKit(const std::string& childRoot,
                                 const std::string& loTemplate,
                                 const std::string& loSubPath)
 {
-    Process::PID childPID = 0;
-
     Log::debug("Forking a loolkit process.");
 
     Process::PID pid;
@@ -107,14 +105,13 @@ static int createLibreOfficeKit(const std::string& childRoot,
     else
     {
         // parent
-        childPID = pid; // (somehow - switch the hash to use real pids or ?) ...
         if (pid < 0)
             Log::syserror("Fork failed.");
         else
-            Log::info("Forked kit [" + std::to_string(childPID) + "].");
+            Log::info("Forked kit [" + std::to_string(pid) + "].");
     }
 
-    return childPID;
+    return pid;
 }
 
 static void printArgumentHelp()
commit ca4d8ea4512f5be1c82aea9af65353f706b129eb
Author: Tor Lillqvist <tml at collabora.com>
Date:   Fri Apr 8 13:06:16 2016 +0300

    ChildCounter is never incremented or decremented

diff --git a/loolwsd/LOOLForKit.cpp b/loolwsd/LOOLForKit.cpp
index 9daec90..ee3b78a 100644
--- a/loolwsd/LOOLForKit.cpp
+++ b/loolwsd/LOOLForKit.cpp
@@ -41,7 +41,6 @@ using Poco::Timestamp;
 using Poco::Util::Application;
 
 static std::atomic<unsigned> ForkCounter( 0 );
-static unsigned int ChildCounter = 0;
 
 static int pipeFd = -1;
 
@@ -115,7 +114,6 @@ static int createLibreOfficeKit(const std::string& childRoot,
             Log::info("Forked kit [" + std::to_string(childPID) + "].");
     }
 
-    Log::info() << "Created Kit #" << ChildCounter << ", PID: " << childPID << Log::end;
     return childPID;
 }
 


More information about the Libreoffice-commits mailing list