Leopard, CoreFoundation, and exec()
Under Leopard, using Mac::Carbon:
So in the happening program, I had:
[pudge@bourque ~]$ happeningApparently, fork-without-exec with CoreFoundation has always been bad. But it is now an exception.
Running background process/Users/pudge/bin/happening (983)
The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().
Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_C OREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() to debug.
So in the happening program, I had:
$pid = fork;Now I have:
exit if $pid;
if (!$nofork) {YMMV.
$pid = fork;
exit if $pid;
exec($0, '-nofork');
}
Leave a comment