From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.134]) by sourceware.org (Postfix) with ESMTPS id 4C689386102F for ; Fri, 19 Mar 2021 12:58:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4C689386102F Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MavF5-1lzKkk3Z8d-00cPbR for ; Fri, 19 Mar 2021 13:58:41 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id 0771DA80DE0; Fri, 19 Mar 2021 13:58:41 +0100 (CET) Date: Fri, 19 Mar 2021 13:58:40 +0100 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: stdin pipe rename in 3.2.0 Message-ID: Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <20210319190807.babb0c0312740f44e9119c17@nifty.ne.jp> <20210319210546.a1871ac954d695bceaeb079b@nifty.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210319210546.a1871ac954d695bceaeb079b@nifty.ne.jp> X-Provags-ID: V03:K1:L/4k0K8Eo+Mg+phwM5g9gf++YAdY2NFYt/6v74hPokJpOeFm0IO cZ7UpnpoDMeAV/fqyYjskh8GQp0C05zKX0wtsA6UTZdW1Ql2MpekNJB0cAhn14JMc6I48YD f88gD7yMYROYavF4aYIT3E0uKirKsmVPxYIhlyqKghlE4RfthB0b7vhYEp5lwOzF1k8OW8V EyfQ8g4THFeE47eUXpsRA== X-UI-Out-Filterresults: notjunk:1;V03:K0:FO0FU7nnEag=:71uDuVwZVUlDEvQkGyrKOr PflQ0Q8AJiWU7jCiXwJqfIDVyI1OlRdsodJcP2FhXk1qMmDX15x56kXQXKZC/VV+FMr28KDbr NFLJm6t3kRx3zsWtdSH6kac16YPBKzxkxCWBD9cwfLVZTzxHjbDoBxi8aCtVMSmZWQ5+sdbkc dl+svrMFN/bpxkdbQqBmaCcnBbadNDd5u5nc7NQxaWFrVPLd+kh1sbY+iIgPxKtOhdMr/9ovc 23QCSYyql/Sv5t4xeqJBJ4SZa6I/KcQZE8egWGhYykvAfjYyXoMnj7Ed9Wwk9vR+fiyZAFmfF I92mXyCsL8or/IpZ7zJwzVMEDQwDs+1Vc1sBd/wjS+c2Yvj4WCHFLWhTYJb7X5YwquCFRo+8q j6QFcfpilIHkGEdGLLc1ZB+3NpbRJ/5xEt1FhQkQFn4IBfsKaN8rhuDp5qBTu/Wd9BvgGmWom WnaTQ4iXYg== X-Spam-Status: No, score=-100.8 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Mar 2021 12:58:46 -0000 On Mar 19 21:05, Takashi Yano via Cygwin wrote: > On Fri, 19 Mar 2021 19:08:07 +0900 > Takashi Yano wrote: > > Corinna, is it possble to apply the patch for 3.2.0 release? That's what release testing is for :) > By the way, duaring testing https://github.com/k-takata/ptycheck, > I noticed _get_osfhandle() does not work properly for stdout and > stderr. Shouldn't this > > extern "C" long > _get_osfhandle (int fd) > { > long res; > > cygheap_fdget cfd (fd); > if (cfd >= 0) > res = (long) cfd->get_handle (); > else > res = -1; > > syscall_printf ("%R = get_osfhandle(%d)", res, fd); > return res; > } > > be > > extern "C" long > _get_osfhandle (int fd) > { > long res; > > cygheap_fdget cfd (fd); > if (cfd >= 0) > { > if (fd == 1 || fd == 2) > res = (long) cfd->get_output_handle_cyg (); > else > res = (long) cfd->get_handle_cyg (); > } > else > res = -1; > > syscall_printf ("%R = get_osfhandle(%d)", res, fd); > return res; > } > > ? Maybe. You introduced the "_cyg" handles, so you should know ;) On a more serious note, this is, of course, a compatibility problem. While _get_osfhandle is called by a Cygwin application, nobody knows what dubious actions that application will perform on this handle. In all likelyhood, it fetched the handle to call Windows functions. And *if* it does, wouldn't it make more sense if the non-Cygwin handle is returned? Thanks, Corinna