This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH] Cygwin: pty: Avoid detach console in the process running as service.
- From: Takashi Yano <takashi dot yano at nifty dot ne dot jp>
- To: cygwin-patches at cygwin dot com
- Cc: Takashi Yano <takashi dot yano at nifty dot ne dot jp>
- Date: Wed, 16 Oct 2019 21:34:08 +0900
- Subject: [PATCH] Cygwin: pty: Avoid detach console in the process running as service.
- Dkim-filter: OpenDKIM Filter v2.10.3 conuserg-02.nifty.com x9GCYLi0017325
---
winsup/cygwin/fhandler_tty.cc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index baf3c9794..da6119dfb 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -1048,6 +1048,8 @@ fhandler_pty_slave::try_reattach_pcon (void)
/* Do not detach from the console because re-attaching will
fail if helper process is running as service account. */
+ if (get_ttyp()->attach_pcon_in_fork)
+ return false;
if (pcon_attached_to >= 0 &&
cygwin_shared->tty[pcon_attached_to]->attach_pcon_in_fork)
return false;
--
2.21.0