[PATCH-3-5][PATCH-3-5-5] fdo#50603: Close fds across a restart of soffice on Mac OS X

Lionel Elie Mamane lionel at mamane.lu
Wed Jun 20 23:01:51 PDT 2012


On Mon, Jun 18, 2012 at 01:28:50PM +0200, Stephan Bergmann wrote:

> Via some "remote debugging" I found out the reason for
> <https://bugs.freedesktop.org/show_bug.cgi?id=50603> "Unable to
> update LibreOffice without resetting user profile" is that an
> soffice restarting itself on Mac OS X (when it finds out that the
> per-user information about shared/bundled extensions is not in sync
> upon startup; or after a crash) has file descriptors from the old
> instance still open.

> <http://cgit.freedesktop.org/libreoffice/core/commit/?id=d5e9c2e3e85a2bcdd6a0b2088253fc133e52e831>
> "fdo#50603: Close fds across a restart of soffice on Mac OS X" fixes
> that on master, and I already backported it to libreoffice-3-6.

For my education: why can't we set the O_CLOEXEC/FD_CLOEXEC flag on
these file descriptors? This would - presumably - automatically close
the fds *after* any thread from the "old process" code could possibly
use them, but *before* any code of the new process (after exec())
executes?

-- 
Lionel


More information about the LibreOffice mailing list