* fork.cc (fork_parent): Detect failed pinfo constructor.

* spawn.cc (spawn_guts): Don't overwrite ENOMEM errno on failed pinfo
constructor.
This commit is contained in:
Christopher Faylor 2003-09-26 03:20:30 +00:00
parent 177989407a
commit 6c68fbbc61
3 changed files with 15 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2003-09-25 Christopher Faylor <cgf@redhat.com>
* fork.cc (fork_parent): Detect failed pinfo constructor.
* spawn.cc (spawn_guts): Don't overwrite ENOMEM errno on failed pinfo
constructor.
2003-09-25 Christopher Faylor <cgf@redhat.com>
* spawn.cc (spawnve): Remove vfork short circuit and let caller deal

View File

@ -500,6 +500,13 @@ fork_parent (HANDLE& hParent, dll *&first_dll,
#else
pinfo forked (cygwin_pid (pi.dwProcessId), 1);
#endif
if (!forked)
{
syscall_printf ("pinfo failed");
if (get_errno () != ENOMEM)
set_errno (EAGAIN);
goto cleanup;
}
/* Initialize things that are done later in dll_crt0_1 that aren't done
for the forkee. */

View File

@ -792,7 +792,8 @@ spawn_guts (const char * prog_arg, const char *const *argv,
if (!child)
{
syscall_printf ("pinfo failed");
set_errno (EAGAIN);
if (get_errno () != ENOMEM)
set_errno (EAGAIN);
res = -1;
goto out;
}