Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2020-08-27 22:38:50 +0300
committerCorinna Vinschen <corinna@vinschen.de>2020-08-28 10:44:18 +0300
commit0a31ad6f4c8bf18864b0be3546b402db0a6108f7 (patch)
tree02611382942394ed409cbbfde9438f5a7b5e9905 /winsup/cygwin/sigproc.cc
parent49a9ffdf4bcb3388cde5e4f441dd710701136ba7 (diff)
Cygwin: fix up proc_subproc flags and matching pinfo methods
After patch 23a779bf3d7c2afc9eab88f6b8727c1db5544547 "Cygwin: pinfo: stop remember doing reattach", PROC_ADDCHILD actually just sets up a new child, mirroring PROC_DETACHED_CHILD. The actual attaching of the child is performed by action PROC_REATTACH_CHILD or pinfo::reattach respectively. To better reflect what's going on, rename PROC_REATTACH_CHILD to PROC_ATTACH_CHILD and rename pinfo::reattach to pinfo::attach. For better readability change PROC_ADDCHILD to PROC_ADD_CHILD. Fix comments accordingly. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/sigproc.cc')
-rw-r--r--winsup/cygwin/sigproc.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index a5cf73bde..b29835ee6 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -195,7 +195,7 @@ proc_subproc (DWORD what, uintptr_t val)
/* Add a new subprocess to the children arrays.
* (usually called from the main thread)
*/
- case PROC_ADDCHILD:
+ case PROC_ADD_CHILD:
/* Filled up process table? */
if (nprocs >= NPROCS)
{
@@ -217,11 +217,12 @@ proc_subproc (DWORD what, uintptr_t val)
vchild->ctty = myself->ctty;
vchild->cygstarted = true;
vchild->process_state |= PID_INITIALIZING;
- vchild->ppid = what == PROC_DETACHED_CHILD ? 1 : myself->pid; /* always set last */
+ vchild->ppid = what == PROC_DETACHED_CHILD
+ ? 1 : myself->pid; /* always set last */
}
break;
- case PROC_REATTACH_CHILD:
+ case PROC_ATTACH_CHILD:
procs[nprocs] = vchild;
rc = procs[nprocs].wait ();
if (rc)
@@ -879,7 +880,7 @@ child_info_spawn::wait_for_myself ()
{
postfork (myself);
if (myself.remember (false))
- myself.reattach ();
+ myself.attach ();
WaitForSingleObject (ev, INFINITE);
}
@@ -973,7 +974,7 @@ cygheap_exec_info::reattach_children (HANDLE parent)
pinfo p (parent, children[i].p, children[i].pid);
if (!p)
debug_only_printf ("couldn't reattach child %d from previous process", children[i].pid);
- else if (!p.reattach ())
+ else if (!p.attach ())
debug_only_printf ("attach of child process %d failed", children[i].pid);
else
debug_only_printf ("reattached pid %d<%u>, process handle %p, rd_proc_pipe %p->%p",