From 4ca5a5bc2991438602d3b1fdb56b91d2b425c52d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 17 Jul 2020 17:17:55 +0200 Subject: Fix race in path/mtime assignment and file_rule::match() --- libbuild2/bash/rule.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'libbuild2/bash/rule.cxx') diff --git a/libbuild2/bash/rule.cxx b/libbuild2/bash/rule.cxx index 801f02c..0df9792 100644 --- a/libbuild2/bash/rule.cxx +++ b/libbuild2/bash/rule.cxx @@ -166,13 +166,10 @@ namespace build2 bash& pt (rp.first.as ()); - // Only set mtime/path on first insertion. + // Only set path/mtime on first insertion. // if (rp.second.owns_lock ()) - { - pt.mtime (mt); - pt.path (move (ap)); - } + pt.path_mtime (move (ap), mt); // Save the length of the import path in auxuliary data. We // use it in substitute_import() to infer the installation -- cgit v1.1