summaryrefslogtreecommitdiff
path: root/sal/osl/unx/salinit.cxx
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-08-02 16:41:07 +0300
committerTor Lillqvist <tml@iki.fi>2013-08-02 16:44:27 +0300
commit11bd7758e3bbfcee28343f0f4c233fa3dc4180fb (patch)
treed49400d5f62d601ea284efc8627e502d7e204044 /sal/osl/unx/salinit.cxx
parentcc1e1e9509dd78d043c4b2f345df84635bc7492a (diff)
No self-execing when HAVE_FEATURE_MACOSX_SANDBOX so no need to close fds
Change-Id: Iea03aa4708427772952add0f2fc40012b22e572b
Diffstat (limited to 'sal/osl/unx/salinit.cxx')
-rw-r--r--sal/osl/unx/salinit.cxx16
1 files changed, 9 insertions, 7 deletions
diff --git a/sal/osl/unx/salinit.cxx b/sal/osl/unx/salinit.cxx
index 10553b6cf5cf..d612dbd72cd9 100644
--- a/sal/osl/unx/salinit.cxx
+++ b/sal/osl/unx/salinit.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <config_features.h>
+
#include "sal/config.h"
#if defined MACOSX
@@ -43,19 +45,19 @@ extern "C" {
void sal_initGlobalTimer();
void sal_detail_initialize(int argc, char ** argv) {
-#if defined MACOSX
- // On Mac OS X, soffice can restart itself via exec (see restartOnMac in
- // desktop/source/app/app.cxx), which leaves all file descriptors open,
- // which in turn can have unwanted effects (see
+#if defined MACOSX && !HAVE_FEATURE_MACOSX_SANDBOX
+ // On OS X when not sandboxed, soffice can restart itself via exec (see
+ // restartOnMac in desktop/source/app/app.cxx), which leaves all file
+ // descriptors open, which in turn can have unwanted effects (see
// <https://bugs.freedesktop.org/show_bug.cgi?id=50603> "Unable to update
- // LibreOffice without resetting user profile"). But closing fds in
+ // LibreOffice without resetting user profile"). But closing fds in
// restartOnMac before calling exec does not work, as additional threads
// might still be running then, which can still use those fds and cause
- // crashes. Therefore, the simples solution is to close fds at process
+ // crashes. Therefore, the simplest solution is to close fds at process
// start (as early as possible, so that no other threads have been created
// yet that might already have opened some fds); this is done for all kinds
// of processes here, not just soffice, but hopefully none of our processes
- // rely on being spawned with certain fds already open. Unfortunately, Mac
+ // rely on being spawned with certain fds already open. Unfortunately, Mac
// OS X appears to have no better interface to close all fds (like
// closefrom):
long openMax = sysconf(_SC_OPEN_MAX);