From f8408539216cc213fa780560b7396af8ba801e2e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 25 Nov 2022 08:18:06 +0200 Subject: Fix diag buffer opining logic in cc::compile_rule --- libbuild2/cc/compile-rule.cxx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'libbuild2/cc') diff --git a/libbuild2/cc/compile-rule.cxx b/libbuild2/cc/compile-rule.cxx index 874674d..51d9b4d 100644 --- a/libbuild2/cc/compile-rule.cxx +++ b/libbuild2/cc/compile-rule.cxx @@ -4148,9 +4148,12 @@ namespace build2 nullptr, // CWD env.empty () ? nullptr : env.data ()); - dbuf.open (args[0], - move (pr.in_efd), - fdstream_mode::non_blocking); // Skip on stdout. + if (cclass != compiler_class::msvc && gen) + { + dbuf.open (args[0], + move (pr.in_efd), + fdstream_mode::non_blocking); // Skip on stdout. + } } else // Dependency info goes to temporary file. { @@ -4169,8 +4172,11 @@ namespace build2 nullptr, // CWD env.empty () ? nullptr : env.data ()); - dbuf.open (args[0], move (pr.in_efd)); - dbuf.read (sense_diag /* force */); + if (gen || sense_diag) + { + dbuf.open (args[0], move (pr.in_efd)); + dbuf.read (sense_diag /* force */); + } if (sense_diag) { -- cgit v1.1