public inbox for cygwin-developers@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin-developers@cygwin.com
Subject: Re: set_open_status
Date: Thu, 18 Feb 2021 10:07:45 +0100	[thread overview]
Message-ID: <YC4uYeb/P7qjxM4w@calimero.vinschen.de> (raw)
In-Reply-To: <562a95df-6685-c6cf-d57d-dfd292925b23@cornell.edu>

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

  reply	other threads:[~2021-02-18  9:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-17 21:35 set_open_status Ken Brown
2021-02-18  9:07 ` Corinna Vinschen [this message]
2021-02-18 13:07   ` set_open_status Corinna Vinschen
2021-02-18 21:23     ` set_open_status Ken Brown
2021-02-19 17:15       ` set_open_status Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YC4uYeb/P7qjxM4w@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin-developers@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).