aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/bash
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-07-17 17:17:55 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-07-17 17:17:55 +0200
commit4ca5a5bc2991438602d3b1fdb56b91d2b425c52d (patch)
treeb9a2f6f801031af9299bfc45095eac1eb3ceb495 /libbuild2/bash
parentab4a9ef42e8f1070dcb5d783a5afccd2f685e86d (diff)
Fix race in path/mtime assignment and file_rule::match()
Diffstat (limited to 'libbuild2/bash')
-rw-r--r--libbuild2/bash/rule.cxx7
1 files changed, 2 insertions, 5 deletions
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<bash> ());
- // 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