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

Henry Castro hcastro at collabora.com
Tue Feb 16 21:12:26 UTC 2016


 loolwsd/LOOLBroker.cpp |    4 ++--
 loolwsd/LOOLWSD.cpp    |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 9b4099c41cd11d8cd05e90e4aa8c45c37a83207f
Author: Henry Castro <hcastro at collabora.com>
Date:   Tue Feb 16 17:11:33 2016 -0400

    loolwsd: check if the named pipes exists

diff --git a/loolwsd/LOOLBroker.cpp b/loolwsd/LOOLBroker.cpp
index 0b41fee..b29b4a9 100644
--- a/loolwsd/LOOLBroker.cpp
+++ b/loolwsd/LOOLBroker.cpp
@@ -491,7 +491,7 @@ static int createLibreOfficeKit(const bool sharePages,
     const Path pipePath = Path::forDirectory(childRoot + Path::separator() + FIFO_PATH);
     const std::string pipeKit = Path(pipePath, BROKER_PREFIX + std::to_string(childCounter++) + BROKER_SUFIX).toString();
 
-    if (mkfifo(pipeKit.c_str(), 0666) < 0)
+    if (mkfifo(pipeKit.c_str(), 0666) < 0 && errno != EEXIST)
     {
         Log::error("Error: Failed to create pipe FIFO [" + pipeKit + "].");
         return -1;
@@ -750,7 +750,7 @@ int main(int argc, char** argv)
 
     int nFlags = O_RDONLY | O_NONBLOCK;
     const std::string pipeBroker = Path(pipePath, FIFO_BROKER).toString();
-    if (mkfifo(pipeBroker.c_str(), 0666) == -1)
+    if (mkfifo(pipeBroker.c_str(), 0666) < 0 && errno != EEXIST)
     {
         Log::error("Error: Failed to create pipe FIFO [" + FIFO_BROKER + "].");
         exit(Application::EXIT_SOFTWARE);
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index ef37ab5..8d4cff1 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -941,7 +941,7 @@ int LOOLWSD::main(const std::vector<std::string>& /*args*/)
     }
 
     const std::string pipeLoolwsd = Path(pipePath, FIFO_LOOLWSD).toString();
-    if (mkfifo(pipeLoolwsd.c_str(), 0666) == -1)
+    if (mkfifo(pipeLoolwsd.c_str(), 0666) < 0 && errno != EEXIST)
     {
         Log::error("Error: Failed to create pipe FIFO [" + pipeLoolwsd + "].");
         return Application::EXIT_SOFTWARE;


More information about the Libreoffice-commits mailing list