From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.13]) by sourceware.org (Postfix) with ESMTPS id AD75F387086D for ; Thu, 18 Feb 2021 09:07:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AD75F387086D Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mq2Sa-1lh21L3ckE-00n8Cj for ; Thu, 18 Feb 2021 10:07:45 +0100 Received: by calimero.vinschen.de (Postfix, from userid 500) id 6C4CBA80671; Thu, 18 Feb 2021 10:07:45 +0100 (CET) Date: Thu, 18 Feb 2021 10:07:45 +0100 From: Corinna Vinschen To: cygwin-developers@cygwin.com Subject: Re: set_open_status Message-ID: Reply-To: cygwin-developers@cygwin.com Mail-Followup-To: cygwin-developers@cygwin.com References: <562a95df-6685-c6cf-d57d-dfd292925b23@cornell.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <562a95df-6685-c6cf-d57d-dfd292925b23@cornell.edu> X-Provags-ID: V03:K1:owrLQlryPaedfFodQAb1Hee4DfsSok0gs3jolDbUgjferZom34F vYH3T6tRkMsM8fw6Mx8r6+WABmtaVSgtFP6OEa5V8eq5DUL2TRMmEuMok4daiJfxpyEGgxW WuocwomdJ3zrrGNxhMuY9qzBNVY8lzmNH6Z/1jDLwuDAD2K9RhULAWyCkttmfCLfUv2EZkm lRT89YkUK0LqGcDltLmhg== X-UI-Out-Filterresults: notjunk:1;V03:K0:6+i6a20m/a4=:2O/BqAilqppLMs++/YDR/f 4a+o/KbmZVUfIt5L8Z6hjNgMZa0BRFpuB2l7KBarAXFAUHEaGa1/LG3qmAB8onwxGcjTA/kp3 6pfYnUof2S5vH3AN43e7eyxrkdNQmYp5f1GX/tOdvK+lYSJ/xsJTnsuT29fqxjsaubmZ8XIB/ ibx/CeCKYgIg2ajKoIoJy3SGZI5eyf7V3ycjuoiiXy0cwBcvMjC6mDxoqzfebmLpGMbQZbO4E 67V6Ise8E5hv+Js3Nt1yvtThUEfhDMMo3YY9a64qa8Y0c0UX+aGQr4pnXqBLr3yYVM28/dykw XRD4upasJLfvl+vBGq7Ylg+xzyHjh+MfkqEmQslPOv5X/WVWdeX1c203IolmUwOg1JOKHornK HZ1jDynH3Ra2cxmazvLNA0cUlQHSTY5tmNXGQLq751AxIboRuX2TY1ZzafaOr8wT19YKcahnn o8ei1TSd1g== X-Spam-Status: No, score=-101.3 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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-developers@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component developers mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2021 09:07:51 -0000 On Feb 17 16:35, Ken Brown via Cygwin-developers wrote: > Most fhandlers call set_open_status in their 'open' method before a > successful return. I just noticed that fhandler_fifo::open doesn't do this. > I thought at first that it was an oversight on my part from when I > overhauled the FIFO implementation, but I just checked fhandler_fifo.cc as > of cygwin 2.9.0, and I don't see it there either. > > Is there some reason this would be wrong for FIFOs? I guess this was just an oversight. It's certainly not fatal, given how open_status is used exclusively by fhandler_base::reset_to_open_binmode() in turn *only* called from setmode(fd, 0). This is quite a bordercase. Combined with FIFOs supporting only O_BINARY mode anyway... It won't hurt to add the set_open_mode call to FIFOs but it won't change anything, except avoiding to report O_TEXT mode after a call to setmode(fd, 0). Maybe it would be better to change fhandler_base::reset_to_open_binmode instead. Right now, if open_status hasn't been initialized, it prefers O_TEXT over O_BINARY. That's unfortunate, because it forces us to call set_open_mode everywhere to make sure the mode is stored correctly for this single, and seldom, invocation of setmode(fd, 0). It would be nice if set_open_mode would only be necessary on fhandlers supporting O_TEXT at all. Corinna