Throughout, change check for running under Windows NT to 'iswinnt'.

* dcrt0.cc (set_os_type): Set 'iswinnt' appropriately.
* cygheap.cc (init_cheap): Revert to using VirtualAlloc for allocating cygheap.
(cygheap_setup_for_child_cleanup): New function.  Standard function to call
after calling CreateProcess to cleanup cygheap info passed to child.
(cygheap_fixup_in_child): Copy cygheap from shared memory into allocated space
under Windows 9x or if can't relocate shared space under NT.
* cygheap.h: Declare new function.
* spawn.cc (spawn_guts): Use cygheap_fixup_in_child.
* fork.cc (fork_parent): Ditto.
* winsup.h: Declare iswinnt.
This commit is contained in:
Christopher Faylor
2001-08-04 21:10:52 +00:00
parent 17195d08bc
commit e5ba4c060e
27 changed files with 105 additions and 76 deletions

View File

@ -116,7 +116,7 @@ fork_copy (PROCESS_INFORMATION &pi, const char *what, ...)
debug_printf ("done");
return 1;
err:
err:
TerminateProcess (pi.hProcess, 1);
set_errno (EAGAIN);
return 0;
@ -458,7 +458,7 @@ fork_parent (HANDLE& hParent, dll *&first_dll,
npid = 0;
}
}
out:
out:
#endif
char sa_buf[1024];
@ -477,7 +477,7 @@ out:
&pi);
CloseHandle (hParent);
ForceCloseHandle1 (ch.cygheap_h, passed_cygheap_h);
cygheap_setup_for_child_cleanup (&ch);
if (!rc)
{
@ -607,7 +607,7 @@ out:
return forked->pid;
/* Common cleanup code for failure cases */
cleanup:
cleanup:
/* Remember to de-allocate the fd table. */
if (pi.hProcess)
ForceCloseHandle1 (pi.hProcess, childhProc);