[REVIEW 3-5-5 (2/3)][PUSHED 3-5] fdo#50603: Close fds across a restart of soffice on Mac OS X

Michael Meeks michael.meeks at suse.com
Tue Jun 19 07:20:05 PDT 2012


On Tue, 2012-06-19 at 15:43 +0200, Stephan Bergmann wrote:
> On 06/19/2012 02:52 PM, Michael Meeks wrote:
> > 	It -looks- like you do this on every startup, when in fact we really
> > only want to do it -before- we run 'exec' in this rather rare re-start
> > condition :-)
> 
> For the given scenario, we really only need to do it *after* exec under 
> the restart condition on Mac OS X (not *before,* due to additional 
> threads still running then that must not be irritated by closing fds 
> they still operate on).  So doing it upon *every* start on Mac OS X 
> appeared to be the easiest fix.

	Grief - but calling 'exec' is unlikely to leave the threads around of
the previous process in some unharmed state - surely it will just
terminate them all [ presumably that is what we want ;-].

	If not, a quick:

	if (!fork()) {
		// close all sockets
		exec (...);
	}

	Would presumably do what we want (?) :-) Hopefully we're not counting
on some configuration writer thread to write the config :-)

	Anyhow, if the fd limit is 256 it's hardly going to be a big hit
anyway, so no real problem.

	Thanks,

		Michael.

-- 
michael.meeks at suse.com  <><, Pseudo Engineer, itinerant idiot



More information about the LibreOffice mailing list