Is ninja actually minding STDERR?

248 views
Skip to first unread message

Kevin Ingwersen (Ingwie Phoenix)

unread,
Nov 9, 2014, 8:47:05 PM11/9/14
to ninja-build
Hey.

While writing on a program that needs to execute child processes, I had to look into Ninja’s code to find a more…cross-platform method. But that brought to my attention, that many people, like on StackOverflow, suggest to just use a redirection instead of creating a pipe for STDOUT and STDERR. I wanted to know, if Ninja actually uses two different pipes or just redirects STDERR into STDOUT and only checks failure on the exit status?

Would be nice to know, since I didn’t find the relative part in the code yet, nly just got thru reading sub_process.cc…

Kind regards, Ingwie

Evan Martin

unread,
Nov 9, 2014, 9:49:39 PM11/9/14
to Ingwie Phoenix, ninja-build

https://github.com/martine/ninja/blob/master/src/subprocess-posix.cc

Search for dup2. FD 1 is stdout, fd 2 is stderr.

brevity due to phone

--
You received this message because you are subscribed to the Google Groups "ninja-build" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ninja-build...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages