summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/dcrt0.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-11-15 06:27:48 +0000
committerChristopher Faylor <me@cgf.cx>2000-11-15 06:27:48 +0000
commit84aeff4126777c437a15c052f08be026f384ab70 (patch)
tree0d8fdcaf5f04948137e352b0f8b1e31e78925122 /winsup/cygwin/dcrt0.cc
parentfb0a87573362f64e9c26036f8c887c930fa9ca6a (diff)
downloadcygnal-84aeff4126777c437a15c052f08be026f384ab70.tar.gz
cygnal-84aeff4126777c437a15c052f08be026f384ab70.tar.bz2
cygnal-84aeff4126777c437a15c052f08be026f384ab70.zip
Throughout use myself->ppid_handle rather than parent_alive.
* child_info.h (child_info): Eliminate parent_alive. * dcrt0.cc (dll_crt0_1): Call fork_init for debugging pid creation. * fork.cc (fork_child): Reflect change to fixup_mmaps_after_fork arguments. (slow_pid_reuse): New function to grab last 'n' pids to prevent pid reuse. (fork_parent): Move last_fork_proc into slow_pid_reuse. Handle fork_pids debugging. Eliminate unnecessary call to set_child_mmap_ptr. (fork_init): New debugging function. * mmap.cc (fixup_mmaps_after_fork): Renamed from recreate_mmaps_after_fork. Rely on copied data after a fork. (set_child_mmap_ptr): Eliminate. * pinfo.h (_pinfo): Eliminate parent_alive, mmap_ptr and reflect above changes. * spawn.cc (spawn_guts): Eliminate vestiges of "old way" of sending new hProc to parent process.
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r--winsup/cygwin/dcrt0.cc19
1 files changed, 7 insertions, 12 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index c0a9f50d3..1acffca4c 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -56,7 +56,6 @@ BOOL display_title = FALSE;
BOOL strip_title_path = FALSE;
BOOL allow_glob = TRUE;
-HANDLE NO_COPY parent_alive = NULL;
int cygwin_finished_initializing = 0;
/* Used in SIGTOMASK for generating a bit for insertion into a sigset_t.
@@ -739,7 +738,6 @@ dll_crt0_1 ()
cygcwd.init ();
cygbench ("pre-forkee");
-
if (user_data->forkee)
{
/* If we've played with the stack, stacksize != 0. That means that
@@ -758,6 +756,13 @@ dll_crt0_1 ()
longjmp (fork_info->jmp, fork_info->cygpid);
}
+#ifdef DEBUGGING
+ {
+ extern void fork_init ();
+ fork_init ();
+ }
+#endif
+
/* Initialize our process table entry. */
pinfo_init (envp, envc);
@@ -910,16 +915,6 @@ _dll_crt0 ()
mypid = child_proc_info->cygpid;
cygwin_shared_h = child_proc_info->shared_h;
console_shared_h = child_proc_info->console_h;
-
- /* We don't want subprocesses to inherit this */
- if (dynamically_loaded)
- parent_alive = NULL;
- else if (!DuplicateHandle (hMainProc, child_proc_info->parent_alive,
- hMainProc, &parent_alive, 0, 0,
- DUPLICATE_SAME_ACCESS
- | DUPLICATE_CLOSE_SOURCE))
- system_printf ("parent_alive DuplicateHandle failed, %E");
-
break;
}
default: