loolwsd/LOOLBroker.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
New commits: commit 764f9f398ad86004509f5d8b3c527fc40c787bb6 Author: Henry Castro <hcas...@collabora.com> Date: Sun Sep 27 17:33:05 2015 -0400 loolwsd: create reader FIFO to read messages from childs diff --git a/loolwsd/LOOLBroker.cpp b/loolwsd/LOOLBroker.cpp index 1c52500..f120ff6 100644 --- a/loolwsd/LOOLBroker.cpp +++ b/loolwsd/LOOLBroker.cpp @@ -57,9 +57,12 @@ using Poco::Process; using Poco::Thread; using Poco::ProcessHandle; +const std::string FIFO_BROKER = "/tmp/loolbroker.fifo"; const std::string BROKER_SUFIX = ".fifo"; const std::string BROKER_PREFIX = "/tmp/lokit"; +static int readerChild = -1; + static unsigned int childCounter = 0; static std::map<Poco::Process::PID, int> _childProcesses; @@ -466,6 +469,12 @@ int main(int argc, char** argv) dropCapability(); #endif + if (mkfifo(FIFO_BROKER.c_str(), 0666) == -1) + { + std::cout << Util::logPrefix() << "Fail to create pipe FIFO " << strerror(errno) << std::endl; + exit(-1); + } + bool sharePages = globalPreinit(loSubPath); if ( startupLibreOfficeKit(sharePages, _numPreSpawnedChildren, loSubPath, _childId) < 0 ) @@ -474,6 +483,12 @@ int main(int argc, char** argv) exit(-1); } + if ( (readerChild = open(FIFO_BROKER.c_str(), O_RDONLY) ) < 0 ) + { + std::cout << Util::logPrefix() << "pipe opened for reading: " << strerror(errno) << std::endl; + exit(-1); + } + while (_childProcesses.size() > 0) { int status; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits