From: Florian Weimer Date: Sat, 28 Oct 2006 13:30:27 GMT Subject: Re: lockfiles & fork() Message-ID: <87fyd8ftzg.fsf@mid.deneb.enyo.de> In-Reply-To: * Johannes Schindelin: > when you setup a lockfile, and then fork(), you could easily end up with > atexit() kicking in to remove the lockfile, before the main process has a > chance to commit. (Yes, I need to hold the lock long before the fork()). > > Any ideas how to solve the problem? I think you should call _exit in the child instead of exit.