Question about PID_NEW_PG in child_info_spawn::worker
Jeremy Drake
cygwin@jdrake.com
Fri Jun 27 21:12:28 GMT 2025
I've been poking around in child_info_spawn lately, and I've noticed
commit 8d8724ee1b5aa6a1b080c76a0dec3678136d4981 ("Cygwin: pty: Fix Ctrl-C
handling further for non-cygwin apps.") added the following (it's since
been revised to an InterlockedOr, but that's not relevant to my question):
if (c_flags & CREATE_NEW_PROCESS_GROUP)
myself->process_state |= PID_NEW_PG;
My question is, if mode != _P_OVERLAY, shouldn't that flag be set on the
child's pinfo rather than myself? It seems the child's pinfo isn't
created until after the CreateProcess though. If that is the case, maybe
the myself->set_has_pgid_children () call needs to only be called if that
flag is not (going to be) set?
More information about the Cygwin
mailing list