No CF calls between fork() and exec()

Ensure no CoreFoundation calls are made between fork() and exec()
otherwise Mac OS X may crash and burn.
This commit is contained in:
Nico Weber
2008-02-16 18:26:01 +01:00
committed by Bjorn Winckler
parent 84a3908488
commit 9265b87738
2 changed files with 4 additions and 7 deletions
-3
View File
@@ -1527,9 +1527,6 @@ gui_macvim_add_to_find_pboard(char_u *pat)
{
if (!pat) return;
// HACK: Do not call Cocoa during a fork or bad things (TM) will happen.
if (gui.dofork) return;
#ifdef FEAT_MBYTE
pat = CONVERT_TO_UTF8(pat);
#endif
+4 -4
View File
@@ -163,6 +163,10 @@ http://developer.apple.com/documentation/Darwin/Reference/ManPages/man2/fork.2.h
}
newargv[argc+1] = NULL;
/* shut down all the stuff we just started, just to start
* it again from the exec :-\ */
prepare_getout();
pid = fork();
switch(pid) {
case -1:
@@ -173,10 +177,6 @@ http://developer.apple.com/documentation/Darwin/Reference/ManPages/man2/fork.2.h
case 0:
/* Child. */
/* shut down all the stuff we just started, just to start
* it again from the exec :-\ */
prepare_getout();
/* make sure we survive our shell */
setsid();