aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-11-22 14:41:56 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-11-22 14:41:56 +0200
commite7daf01b84ee6ae96915390d9e2f3c5defaaf1ca (patch)
treec1f9962dc1ce4ef513e1ed5101a176ea0d3236f9
parent5f9dcd5364993f32e6841ffdfefce1cc87017b22 (diff)
Tweak in rule to ensure correct mtime order
-rw-r--r--build2/in/rule.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/build2/in/rule.cxx b/build2/in/rule.cxx
index 545ded5..7b3904c 100644
--- a/build2/in/rule.cxx
+++ b/build2/in/rule.cxx
@@ -378,7 +378,9 @@ namespace build2
}
what = "write"; whom = &tp;
- ofs << s << endl;
+ if (ln != 1)
+ ofs << endl; // See below.
+ ofs << s;
}
// Close depdb before closing the output file so its mtime is not
@@ -387,6 +389,7 @@ namespace build2
dd.close ();
what = "close"; whom = &tp;
+ ofs << endl; // Last write to make sure our mtime is older than dd.
ofs.close ();
arm.cancel ();