loolwsd/LOOLBroker.cpp |    2 --
 loolwsd/LOOLKit.cpp    |   11 +++++++++++
 2 files changed, 11 insertions(+), 2 deletions(-)

New commits:
commit c1ca746f669409771b65c60f37debcf88d599a18
Author: Pranav Kant <pran...@collabora.com>
Date:   Thu Mar 3 23:17:36 2016 +0530

    loolwsd: Make notify pipe accessible from child processes
    
    Change-Id: Id91a38c2997cfb359aff0a42d000e9659653598b
    Reviewed-on: https://gerrit.libreoffice.org/22830
    Reviewed-by: Tor Lillqvist <t...@collabora.com>
    Tested-by: Tor Lillqvist <t...@collabora.com>

diff --git a/loolwsd/LOOLBroker.cpp b/loolwsd/LOOLBroker.cpp
index d1ab001..fcf1333 100644
--- a/loolwsd/LOOLBroker.cpp
+++ b/loolwsd/LOOLBroker.cpp
@@ -31,13 +31,11 @@ typedef int (LokHookPreInit)  ( const char *install_path, 
const char *user_profi
 using Poco::ProcessHandle;
 
 const std::string FIFO_LOOLWSD = "loolwsdfifo";
-const std::string FIFO_NOTIFY = "loolnotify.fifo";
 const std::string BROKER_SUFIX = ".fifo";
 const std::string BROKER_PREFIX = "lokit";
 
 static int readerChild = -1;
 static int readerBroker = -1;
-static int writerNotify = -1;
 
 static std::string loolkitPath;
 static std::atomic<unsigned> forkCounter;
diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index 31b659d..e9a6fbb 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -70,6 +70,9 @@ using Poco::ThreadLocal;
 const std::string CHILD_URI = "/loolws/child/";
 const std::string FIFO_PATH = "pipe";
 const std::string FIFO_BROKER = "loolbroker.fifo";
+const std::string FIFO_NOTIFY = "loolnotify.fifo";
+
+static int writerNotify = -1;
 
 namespace
 {
@@ -811,6 +814,14 @@ void lokit_main(const std::string& childRoot,
             std::exit(Application::EXIT_SOFTWARE);
         }
 
+        // Open notify pipe
+        const std::string pipeNotify = Path(pipePath, FIFO_NOTIFY).toString();
+        if ((writerNotify = open(pipeNotify.c_str(), O_WRONLY) ) < 0)
+        {
+            Log::error("Error: pipe opened for writing.");
+            exit(Application::EXIT_SOFTWARE);
+        }
+
         const Path jailPath = Path::forDirectory(childRoot + Path::separator() 
+ jailId);
         Log::info("Jail path: " + jailPath.toString());
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to