From 701d19fb4fd4fbafb8317b4305614715aeb9e4f9 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 4 Feb 2013 23:46:16 +0200 Subject: Ignore IPC socket setup errors on OS X as they occur always when sandboxed In a sandboxed LibreOffice, on 10.8.2 at least, creating the Unix domain socket fails. Ignore that as hopefully people running a sandboxed LO won't attempt starting it from the command-line or in other tricky ways, so the normal OS X mechanism that prevents multiple instances of an app from being started should work fine. I hope. Change-Id: I4e0aa0c823328d00c8ff1c039859e78ba8ae92c5 --- desktop/source/app/app.cxx | 22 +++++++++++++++++++++- desktop/source/app/officeipcthread.cxx | 2 +- desktop/source/app/officeipcthread.hxx | 1 + 3 files changed, 23 insertions(+), 2 deletions(-) (limited to 'desktop') diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index c541566937e4..0f239d1a6485 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -596,7 +596,27 @@ void Desktop::Init() // start ipc thread only for non-remote offices RTL_LOGFILE_CONTEXT( aLog2, "desktop (cd100003) ::OfficeIPCThread::EnableOfficeIPCThread" ); OfficeIPCThread::Status aStatus = OfficeIPCThread::EnableOfficeIPCThread(); - if ( aStatus == OfficeIPCThread::IPC_STATUS_BOOTSTRAP_ERROR ) + if ( aStatus == OfficeIPCThread::IPC_STATUS_PIPE_ERROR ) + { +#ifdef MACOSX + // In a sandboxed LO, on 10.8.2 at least, creating the + // Unix domain socket fails. Ignore that as hopefully + // people running a sandboxed LO won't attempt starting it + // from the command-line or otherwise in tricky ways, so + // the normal OS X mechanism that prevents multiple + // instances of an app from being started should work + // fine. I hope. +#else + // Keep using this oddly named BE_PATHINFO_MISSING value + // for pipe-related errors on other platforms. Of course + // this crack with two (if not more) levels of our own + // error codes hiding the actual system error code is + // broken, but that is done all over the code, let's leave + // re-enginering that to another year. + SetBootstrapError( BE_PATHINFO_MISSING, OUString() ); +#endif + } + else if ( aStatus == OfficeIPCThread::IPC_STATUS_BOOTSTRAP_ERROR ) { SetBootstrapError( BE_PATHINFO_MISSING, OUString() ); } diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index cc9dd37ad0cd..129e8842b4c4 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -525,7 +525,7 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread() { oslPipeError eReason = pThread->maPipe.getError(); if ((eReason == osl_Pipe_E_ConnectionRefused) || (eReason == osl_Pipe_E_invalidError)) - return IPC_STATUS_BOOTSTRAP_ERROR; + return IPC_STATUS_PIPE_ERROR; // Wait for second office to be ready TimeValue aTimeValue; diff --git a/desktop/source/app/officeipcthread.hxx b/desktop/source/app/officeipcthread.hxx index 440fd247d2a9..f60084d4dd00 100644 --- a/desktop/source/app/officeipcthread.hxx +++ b/desktop/source/app/officeipcthread.hxx @@ -107,6 +107,7 @@ class OfficeIPCThread : public salhelper::Thread { IPC_STATUS_OK, IPC_STATUS_2ND_OFFICE, + IPC_STATUS_PIPE_ERROR, IPC_STATUS_BOOTSTRAP_ERROR }; -- cgit