From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 70657 invoked by alias); 26 Sep 2019 12:49:14 -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 70368 invoked by uid 9996); 26 Sep 2019 12:49:14 -0000 Date: Thu, 26 Sep 2019 12:49:00 -0000 Message-ID: <20190926124914.70362.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: Fix PTY so that cygwin setup shows help with -h option. X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano X-Git-Refname: refs/heads/master X-Git-Oldrev: 7e9b1550fd1c9690bc560404388ba4907d10996a X-Git-Newrev: e1a0775dc0545b5f9c81b09a327fc110c538b7b4 X-SW-Source: 2019-q3/txt/msg00090.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=e1a0775dc0545b5f9c81b09a327fc110c538b7b4 commit e1a0775dc0545b5f9c81b09a327fc110c538b7b4 Author: Takashi Yano Date: Thu Sep 26 19:52:46 2019 +0900 Cygwin: pty: Fix PTY so that cygwin setup shows help with -h option. - After commit 169d65a5774acc76ce3f3feeedcbae7405aa9b57, cygwin setup fails to show help message when -h option is specified, as reported in https://cygwin.com/ml/cygwin/2019-09/msg00248.html. This patch fixes the problem. Diff: --- winsup/cygwin/spawn.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 4d8bcc9..f8090a6 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -790,8 +790,6 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv, NtClose (old_winpid_hdl); real_path.get_wide_win32_path (myself->progname); // FIXME: race? sigproc_printf ("new process name %W", myself->progname); - if (!iscygwin ()) - close_all_files (); } else { @@ -890,6 +888,8 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv, wait_for_myself (); } myself.exit (EXITCODE_NOSET); + if (!iscygwin ()) + close_all_files (); break; case _P_WAIT: case _P_SYSTEM: