[Libreoffice-commits] core.git: sal/osl

Tor Lillqvist tml at iki.fi
Fri Aug 2 06:45:01 PDT 2013


 sal/osl/unx/salinit.cxx |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 11bd7758e3bbfcee28343f0f4c233fa3dc4180fb
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Aug 2 16:41:07 2013 +0300

    No self-execing when HAVE_FEATURE_MACOSX_SANDBOX so no need to close fds
    
    Change-Id: Iea03aa4708427772952add0f2fc40012b22e572b

diff --git a/sal/osl/unx/salinit.cxx b/sal/osl/unx/salinit.cxx
index 10553b6..d612dbd 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);


More information about the Libreoffice-commits mailing list