* external.cc (fillout_pinfo): Remove nonsensical loop.
* fork.cc (frok::parent): When initializing pinfo for child new PID_NEW flag + actual defined constant rather than raw number. Don't set start_time here. * pinfo.cc (pinfo::thisproc): Use PID_NEW when initializing pinfo. Avoid checking h for NULL multiple times. Don't set start_time here. (pinfo_init): Aways set ppid last. Tweak strace output. (pinfo::init): Handle new PID_NEW flag. Wait for shared memory to contain useful information. Set start_time if PID_NEW. (_onreturn:h): Define as HANDLE rather than HANDLE *. (_onreturn::~onreturn): Accommodate h definition change. (_onreturn::no_close_handle): Rename from no_close_p_handle. Take a pinfo arg and set hProcess to h before zeroing. (winpids::add): Don't open a handle to our own process. Change logic associated with when a handle gets closed. Accommodate no_close_handle changes. (winpids::enum_processes): Simplify process enumeration loop. (winpids::set): Eliminate ill-considered malloc locking. * sigproc.cc (proc_subproc): Always set ppid last.
This commit is contained in:
@@ -344,7 +344,6 @@ frok::parent (volatile char * volatile stack_here)
|
||||
syscall_printf ("CreateProcessW (%W, %W, 0, 0, 1, %y, 0, 0, %p, %p)",
|
||||
myself->progname, myself->progname, c_flags, &si, &pi);
|
||||
bool locked = __malloc_lock ();
|
||||
time_t start_time = time (NULL);
|
||||
|
||||
/* Remove impersonation */
|
||||
cygheap->user.deimpersonate ();
|
||||
@@ -412,7 +411,7 @@ frok::parent (volatile char * volatile stack_here)
|
||||
fix_impersonation = false;
|
||||
|
||||
child_pid = cygwin_pid (pi.dwProcessId);
|
||||
child.init (child_pid, 1, NULL);
|
||||
child.init (child_pid, PID_IN_USE | PID_NEW, NULL);
|
||||
|
||||
if (!child)
|
||||
{
|
||||
@@ -421,7 +420,6 @@ frok::parent (volatile char * volatile stack_here)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
child->start_time = start_time; /* Register child's starting time. */
|
||||
child->nice = myself->nice;
|
||||
|
||||
/* Initialize things that are done later in dll_crt0_1 that aren't done
|
||||
|
Reference in New Issue
Block a user