public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "cygwin-mailinglist" <cygwin-mailinglist@schneiderp.de>
To: "Marco Atzeri" <marco.atzeri@gmail.com>
Cc: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: Re: Redirection to stderr
Date: Mon, 10 Jul 2017 12:02:00 -0000	[thread overview]
Message-ID: <ec89b6011aad4b68a294d3f1d462d40b.squirrel@mail.schneiderp.de> (raw)
In-Reply-To: <b4de479d-882e-4e61-2916-1b54f318d76c@gmail.com>

On Mon, July 10, 2017 12:33, Marco Atzeri wrote:
>
> On 10/07/2017 11:06, cygwin-mailinglist wrote:
[...]
>> Rationale aside, it is a bug, isn't it?
>
> I guess a side effect of a lost race.

Which race, exactly?

> Redirecting something on itself it is not guarantee to work.

I'm not sure it is on itself. Are these not two different streams?

When "some-cmd 2> /dev/stderr" is interpreted by the shell I would expect
that /dev/stderr points to a pipe or terminal *of that shell*. The fd 2 in
"2>", on the other hand, should be the standard error stream *of
some-cmd*. The redirection plugs the two together. Similar reasoning
applies to the outer layers of the redirection onion. Each process has a
/dev/stderr which stays (or, rather, should stay) valid until that process
ends. If there is a redirection, the inner process (e.g. some-cmd) must
not "free" or "delete" the pipe or whatever it is now attached to upon
exit; that stream belongs to the caller, e.g. the shell.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  reply	other threads:[~2017-07-10 12:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <baa3a4f84968dd6aa9869d2c9f58197f.squirrel@mail.schneiderp.de>
2017-07-10 10:33 ` Marco Atzeri
2017-07-10 12:02   ` cygwin-mailinglist [this message]
2017-07-10 13:05     ` Andrey Repin
2017-07-10 13:41       ` Peter Schneider
2017-07-10 16:32         ` Eliot Moss
2017-07-10 18:43     ` Hans-Bernhard Bröker

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=ec89b6011aad4b68a294d3f1d462d40b.squirrel@mail.schneiderp.de \
    --to=cygwin-mailinglist@schneiderp.de \
    --cc=cygwin@cygwin.com \
    --cc=marco.atzeri@gmail.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).