public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Lemke, Michael  ST/HZA-ZSW" <lemkemch@schaeffler.com>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: RE: cygwin 2.0.2, make 4.1: stderr redirect append does not work with native Windows programs
Date: Wed, 13 May 2015 10:34:00 -0000	[thread overview]
Message-ID: <33EC3398272FBE47B64EE3B3E98F69A76C42903B@de011521.schaeffler.com> (raw)
In-Reply-To: <55525B85.90001@coverity.com>

On May 12, 2015 9:59 PM Scott McPeak wrote:
>
>Using 32-bit cygwin 2.0.2 and make 4.1-1, in a recipe, redirecting
>stderr in append mode does not work if the program being invoked on a
>shell line is a native Windows executable.  Instead of appending, the
>stderr output is written to the top of the file, corrupting it. This
>happens only if the 'make' process has its own stdout/err redirected to
>a pipe.
>
>Example recipe:
>
>     all:
>             echo first > output
>             echo
>secondxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx >> output
>             /cygdrive/c/Windows/System32/sort.exe nonexist 2>> output; true
>
>When "make" is run, the "output" file should be:
>
>     first
>     secondxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>     nonexistThe system cannot find the file specified.
>
>and in fact it is.  But when "make 2>&1 | cat" is run, the output is:
>
>     nonexistThe system cannot find the file specified.
>     xxxxxxxxxxxxxx
>
>even though it should be the same as before.  The error message written
>by sort.exe went to the top of the file instead of the end.

Just a wild guess here: line endings?  Try 

make 2>&1 | cat -A 

and see if everything's there.

Michael

--
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:[~2015-05-13  8:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5551188B.7050503@coverity.com>
2015-05-13  3:33 ` Scott McPeak
2015-05-13 10:34   ` Lemke, Michael  ST/HZA-ZSW [this message]
2015-05-14  0:04   ` Scott McPeak
2015-05-15  9:40   ` Takashi Yano
2015-05-16 18:18     ` Scott McPeak
2015-05-27 11:57   ` Corinna Vinschen
2015-05-27 16:25     ` Marco Atzeri

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=33EC3398272FBE47B64EE3B3E98F69A76C42903B@de011521.schaeffler.com \
    --to=lemkemch@schaeffler.com \
    --cc=cygwin@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).