Cygwin: fix up proc_subproc flags and matching pinfo methods

After patch 23a779bf3d
"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>
This commit is contained in:
Corinna Vinschen
2020-08-27 21:38:50 +02:00
parent 49a9ffdf4b
commit 0a31ad6f4c
5 changed files with 15 additions and 14 deletions

View File

@@ -187,18 +187,18 @@ public:
void preserve () { destroy = false; }
void allow_remove () { destroy = true; }
#ifndef SIG_BAD_MASK // kludge to ensure that sigproc.h included
// int reattach () {system_printf ("reattach is not here"); return 0;}
// int attach () {system_printf ("attach is not here"); return 0;}
// int remember (bool) {system_printf ("remember is not here"); return 0;}
#else
int reattach ()
int attach ()
{
int res = proc_subproc (PROC_REATTACH_CHILD, (uintptr_t) this);
int res = proc_subproc (PROC_ATTACH_CHILD, (uintptr_t) this);
destroy = res ? false : true;
return res;
}
int remember (bool detach)
{
int res = proc_subproc (detach ? PROC_DETACHED_CHILD : PROC_ADDCHILD,
int res = proc_subproc (detach ? PROC_DETACHED_CHILD : PROC_ADD_CHILD,
(uintptr_t) this);
destroy = res ? false : true;
return res;