[OT]-ish: Can someone explain this?

Dirk Koopman djk at tobit.co.uk
Tue Jul 5 09:17:34 BST 2011


On 04/07/11 16:40, David Cantrell wrote:
> On Sat, Jul 02, 2011 at 05:32:38PM +0100, Dirk Koopman wrote:
>
>> Here is a bit of C code that is part of something much bigger.
>>
>> 	_exit(0);	
>
> Why _exit instead of exit?
>

Because there is an atexit() handler that a) needs to be active and b) 
does evil[tm] things that are only partially set up at the point where 
this string is output and then _exit()ed.

And nothing whatever to do with the fact that someone couldn't be 
bothered (or was too stressed to) rearrange things so that atexit() is 
called slightly later to enable exit() to be used at that point. Oh no, 
nothing like that at all...

Dirk



More information about the london.pm mailing list