From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7868) id 6608A3856DD4; Sun, 8 May 2022 11:06:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6608A3856DD4 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Takashi Yano To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: pty: Fix timing of creating invisible console. X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano X-Git-Refname: refs/heads/master X-Git-Oldrev: b29fd96cac1df380d2be05892dab35888598186f X-Git-Newrev: 67f12b2ea086f44451792b5fff022742a019f346 Message-Id: <20220508110649.6608A3856DD4@sourceware.org> Date: Sun, 8 May 2022 11:06:49 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2022 11:06:49 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D67f12b2ea08= 6f44451792b5fff022742a019f346 commit 67f12b2ea086f44451792b5fff022742a019f346 Author: Takashi Yano Date: Sun May 8 19:47:05 2022 +0900 Cygwin: pty: Fix timing of creating invisible console. =20 - Previously, invisible console was created in fixup_after_exec(). However, actually this should be done in fixup_after_fork(). this patch fixes the issue. Diff: --- winsup/cygwin/fhandler_tty.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index bdde1dce6..9ab681d6c 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -2467,6 +2467,8 @@ fhandler_pty_slave::bg_check (int sig, bool dontsigna= l) void fhandler_pty_slave::fixup_after_fork (HANDLE parent) { + create_invisible_console (); + // fork_fixup (parent, inuse, "inuse"); // fhandler_pty_common::fixup_after_fork (parent); report_tty_counts (this, "inherited", ""); @@ -2475,8 +2477,6 @@ fhandler_pty_slave::fixup_after_fork (HANDLE parent) void fhandler_pty_slave::fixup_after_exec () { - create_invisible_console (); - if (!close_on_exec ()) fixup_after_fork (NULL); /* No parent handle required. */