aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper/clang_tidy_flag.go
diff options
context:
space:
mode:
authorTobias Bosch <tbosch@google.com>2019-08-16 11:47:00 -0700
committerTobias Bosch <tbosch@google.com>2019-08-20 17:48:54 +0000
commita50a9c16b6a3b2522bea3b6562d023a7b87dbd49 (patch)
tree4d17d8e02962ba4e62c66e49f520cb1b310adc7d /compiler_wrapper/clang_tidy_flag.go
parent36c19215f13c983c2ae0096ed9170fd064744622 (diff)
downloadtoolchain-utils-a50a9c16b6a3b2522bea3b6562d023a7b87dbd49.tar.gz
Forward os.Stdin to child processes.
BUG=chromium:773875 TEST=unit tests, build glibc with compiler wrapper Change-Id: I0b5c1f5adaee18499b72747cd6042b00a9d52c1d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1760973 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Tobias Bosch <tbosch@google.com>
Diffstat (limited to 'compiler_wrapper/clang_tidy_flag.go')
-rw-r--r--compiler_wrapper/clang_tidy_flag.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler_wrapper/clang_tidy_flag.go b/compiler_wrapper/clang_tidy_flag.go
index 5bd67064..616ff47c 100644
--- a/compiler_wrapper/clang_tidy_flag.go
+++ b/compiler_wrapper/clang_tidy_flag.go
@@ -77,8 +77,10 @@ func runClangTidy(env env, clangCmd *command, cSrcFile string) error {
EnvUpdates: clangCmd.EnvUpdates,
}
+ // Note: We pass nil as stdin as we checked before that the compiler
+ // was invoked with a source file argument.
exitCode, err := wrapSubprocessErrorWithSourceLoc(clangTidyCmd,
- env.run(clangTidyCmd, env.stdout(), env.stderr()))
+ env.run(clangTidyCmd, nil, env.stdout(), env.stderr()))
if err == nil && exitCode != 0 {
// Note: We continue on purpose when clang-tidy fails
// to maintain compatibility with the previous wrapper.