summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej.hunt@collabora.com>2014-07-18 13:12:25 +0200
committerAndrzej Hunt <andrzej.hunt@collabora.com>2014-07-26 16:06:32 +0200
commitabbb40ffedc3a102573d412cf3c706be4612a5f3 (patch)
tree69c42b30235b1fd3a71abc4d8fd613ec22fe8b5e
parenteea31395bb68bc57c69147a2870d0e59e11c6756 (diff)
Fail LOK initialisation if restart is required.
Change-Id: Ia13a3523666147f002b5a5177fd6962d55556f56
-rw-r--r--desktop/source/lib/init.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 76d05f36f880..567f5ae26c6f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -661,6 +661,15 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath)
pthread_create(&thread, 0, lo_startmain, NULL);
OfficeIPCThread::WaitForReady();
+ // If the Thread has been disabled again that indicates that a
+ // restart is required (or in any case we don't have a useable
+ // process around).
+ if (!OfficeIPCThread::IsEnabled())
+ {
+ fprintf(stderr, "LOK init failed -- restart required\n");
+ return false;
+ }
+
Application::EnableHeadlessMode(true);
ErrorHandler::RegisterDisplay(aBasicErrorFunc);