From cbcae12587364f4cb7c44b50cc1ae4c8e1fb3bb3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 18 Mar 2021 09:45:06 +0200 Subject: Move file_cache::write:close() call to correct place in cc::compile_rule --- libbuild2/cc/compile-rule.cxx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/libbuild2/cc/compile-rule.cxx b/libbuild2/cc/compile-rule.cxx index e394175..9ae76a9 100644 --- a/libbuild2/cc/compile-rule.cxx +++ b/libbuild2/cc/compile-rule.cxx @@ -4625,7 +4625,12 @@ namespace build2 if (pr.wait ()) { if (!bad_error) // Ignore expected successes (we are done). + { + if (!restart && psrc) + psrcw.close (); + continue; + } fail << "expected error exit status from " << x_lang << " compiler"; @@ -4726,13 +4731,6 @@ namespace build2 } else run_finish (args, pr); // Throws. - - // Success. - // - assert (!restart); - - if (psrc) - psrcw.close (); } catch (const process_error& e) { -- cgit v1.1