* dcrt0.cc (dll_crt0_1): Move set_os_type.

(_dll_crt0): To here.
(cygwin_dll_init): And here.
* external.cc (fillout_pinfo): Use more foolproof method for scanning for pids.
* pinfo.cc (set_myself): Eliminate myself_identity.init.
* sigproc.cc (wait_sig): Do it here instead to reduce the amount of time where
there could potentially be two processes with the same pid.
* spawn.cc (spawn_guts): Eliminate duplicate initialization.
* include/sys/cygwin.h: Mark unused PID_* elements.
This commit is contained in:
Christopher Faylor
2000-08-26 01:36:20 +00:00
parent 14d3488d1f
commit 3c2c374555
7 changed files with 74 additions and 68 deletions

View File

@@ -24,7 +24,6 @@ details. */
static char NO_COPY pinfo_dummy[sizeof(pinfo)] = {0};
pinfo NO_COPY myself ((_pinfo *)&pinfo_dummy); // Avoid myself != NULL checks
static pinfo NO_COPY myself_identity ((_pinfo *)&pinfo_dummy);
/* Initialize the process table.
This is done once when the dll is first loaded. */
@@ -39,9 +38,6 @@ set_myself (pid_t pid, HANDLE h)
myself->dwProcessId = winpid;
myself->process_state |= PID_IN_USE;
myself->start_time = time (NULL); /* Register our starting time. */
pid_t myself_cyg_pid = cygwin_pid (myself->dwProcessId);
if (pid != myself_cyg_pid && parent_alive)
myself_identity.init (myself_cyg_pid, PID_EXECED);
char buf[30];
__small_sprintf (buf, "cYg%8x %x", _STRACE_INTERFACE_ACTIVATE_ADDR,
@@ -95,7 +91,7 @@ pinfo_init (LPBYTE info)
{
/* Invent our own pid. */
set_myself (1, NULL);
set_myself (1);
myself->ppid = 1;
myself->pgid = myself->sid = myself->pid;
myself->ctty = -1;