* fork.cc (vfork): Store complete stack frame in vfork_save structure for later
recovery. * spawn.cc (spawn_guts): Reorganize slightly to consolidate handling when there is a CreateProcess error. (_spawnve): Only longjmp back to vfork handling when a process has been successfuly started. * winsup.h (vfork_save): Extend to include frame info. Remove obsolete cpplus conditionals.
This commit is contained in:
@ -607,7 +607,15 @@ skip_arg_parsing:
|
||||
final debugging message [this is a general rule for debugging
|
||||
messages]. */
|
||||
if (!rc)
|
||||
__seterrno ();
|
||||
|
||||
if (!rc)
|
||||
{
|
||||
if (spr)
|
||||
ForceCloseHandle (spr);
|
||||
__seterrno ();
|
||||
syscall_printf ("CreateProcess failed, %E");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (mode == _P_OVERLAY)
|
||||
cygpid = myself->pid;
|
||||
@ -619,13 +627,6 @@ skip_arg_parsing:
|
||||
rc ? cygpid : (unsigned int) -1,
|
||||
prog_arg, one_line.buf);
|
||||
|
||||
if (!rc)
|
||||
{
|
||||
if (spr)
|
||||
ForceCloseHandle (spr);
|
||||
return -1;
|
||||
}
|
||||
|
||||
MALLOC_CHECK;
|
||||
/* Name the handle similarly to proc_subproc. */
|
||||
ProtectHandle1 (pi.hProcess, childhProc);
|
||||
@ -884,7 +885,7 @@ _spawnve (HANDLE hToken, int mode, const char *path, const char *const *argv,
|
||||
case _P_DETACH:
|
||||
subproc_init ();
|
||||
ret = spawn_guts (hToken, path, argv, envp, mode);
|
||||
if (vf)
|
||||
if (vf && ret > 0)
|
||||
{
|
||||
vf->pid = ret;
|
||||
longjmp (vf->j, 1);
|
||||
|
Reference in New Issue
Block a user