aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/depdb.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-02-08 13:55:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-02-09 10:19:46 +0200
commit382c3d20ab779fe57719bf56cd88a64259c1a3ca (patch)
tree61c116b4594932479b5bb6bc97fe7f9e7846468a /libbuild2/depdb.ixx
parente3f077ba7584f65561e21ca195215abd341b9147 (diff)
Add read-only mode to depdb
Diffstat (limited to 'libbuild2/depdb.ixx')
-rw-r--r--libbuild2/depdb.ixx6
1 files changed, 3 insertions, 3 deletions
diff --git a/libbuild2/depdb.ixx b/libbuild2/depdb.ixx
index 819fadd..18b4351 100644
--- a/libbuild2/depdb.ixx
+++ b/libbuild2/depdb.ixx
@@ -8,7 +8,7 @@ namespace build2
inline depdb_base::
~depdb_base ()
{
- if (state_ != state::write)
+ if (state_ != state::write || ro_)
is_.~ifdstream ();
else
os_.~ofdstream ();
@@ -17,7 +17,7 @@ namespace build2
inline void depdb::
flush ()
{
- if (state_ == state::write)
+ if (state_ == state::write && !ro_)
try
{
os_.flush ();
@@ -37,7 +37,7 @@ namespace build2
inline void depdb::
check_mtime (const path_type& t, timestamp e)
{
- if (state_ == state::write && mtime_check ())
+ if (state_ == state::write && !ro_ && mtime_check ())
check_mtime_ (t, e);
}