* fork.cc (vfork): Avoid recursive vforks.
This commit is contained in:
parent
02a9889121
commit
25e40ae6aa
|
@ -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>
|
Fri Sep 14 00:18:52 2001 Christopher Faylor <cgf@cygnus.com>
|
||||||
|
|
||||||
* fhandler.h (fhandler_pipe::is_slow): Return true only if pipes are
|
* fhandler.h (fhandler_pipe::is_slow): Return true only if pipes are
|
||||||
|
|
|
@ -705,6 +705,8 @@ vfork ()
|
||||||
|
|
||||||
if (vf == NULL)
|
if (vf == NULL)
|
||||||
vf = vfork_storage.create ();
|
vf = vfork_storage.create ();
|
||||||
|
else if (vf->pid)
|
||||||
|
return fork ();
|
||||||
|
|
||||||
if (!setjmp (vf->j))
|
if (!setjmp (vf->j))
|
||||||
{
|
{
|
||||||
|
@ -735,6 +737,8 @@ vfork ()
|
||||||
exit (exitval);
|
exit (exitval);
|
||||||
}
|
}
|
||||||
|
|
||||||
return vf->pid;
|
int pid = vf->pid;
|
||||||
|
vf->pid = 0;
|
||||||
|
return pid;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue