From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 65815 invoked by alias); 17 Oct 2019 16:37:02 -0000 Mailing-List: contact cygwin-cvs-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cygwin-cvs-owner@cygwin.com Received: (qmail 65774 invoked by uid 9996); 17 Oct 2019 16:37:02 -0000 Date: Thu, 17 Oct 2019 16:37:00 -0000 Message-ID: <20191017163702.65772.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Ken Brown To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: pty: Avoid detach console in the process running as service. X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano X-Git-Refname: refs/heads/master X-Git-Oldrev: 9e06ba1ac310c5a2392bb9d150e4686bbb118d6c X-Git-Newrev: 9bedd6807dc3a1ad6c80e62a6a7aae27ca769de0 X-SW-Source: 2019-q4/txt/msg00013.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=9bedd6807dc3a1ad6c80e62a6a7aae27ca769de0 commit 9bedd6807dc3a1ad6c80e62a6a7aae27ca769de0 Author: Takashi Yano Date: Wed Oct 16 21:34:08 2019 +0900 Cygwin: pty: Avoid detach console in the process running as service. Diff: --- 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 1095c82..dbb035f 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;