* fork.cc (vfork): Avoid recursive vforks.

This commit is contained in:
Christopher Faylor 2001-09-14 04:37:57 +00:00
parent 02a9889121
commit 25e40ae6aa
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,7 @@
Fri Sep 14 00:37:54 2001 Christopher Faylor <cgf@cygnus.com>
* fork.cc (vfork): Avoid recursive vforks.
Fri Sep 14 00:18:52 2001 Christopher Faylor <cgf@cygnus.com>
* fhandler.h (fhandler_pipe::is_slow): Return true only if pipes are

View File

@ -705,6 +705,8 @@ vfork ()
if (vf == NULL)
vf = vfork_storage.create ();
else if (vf->pid)
return fork ();
if (!setjmp (vf->j))
{
@ -735,6 +737,8 @@ vfork ()
exit (exitval);
}
return vf->pid;
int pid = vf->pid;
vf->pid = 0;
return pid;
#endif
}