aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/depdb.ixx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-04-16 20:58:19 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-04-16 20:58:19 +0300
commitec0813e4e66172bff73f09772257a580723575bd (patch)
tree3e02bd52ad4d41aefb5baa7b24d490621e8d5ed6 /libbuild2/depdb.ixx
parentc1f396592c5942222fb5446207ab56e8714420e8 (diff)
Fix crashing on unhandled io_error thrown by depdb::flush()
Diffstat (limited to 'libbuild2/depdb.ixx')
-rw-r--r--libbuild2/depdb.ixx9
1 files changed, 9 insertions, 0 deletions
diff --git a/libbuild2/depdb.ixx b/libbuild2/depdb.ixx
index 92afa32..819fadd 100644
--- a/libbuild2/depdb.ixx
+++ b/libbuild2/depdb.ixx
@@ -1,6 +1,8 @@
// file : libbuild2/depdb.ixx -*- C++ -*-
// license : MIT; see accompanying LICENSE file
+#include <libbuild2/diagnostics.hxx>
+
namespace build2
{
inline depdb_base::
@@ -16,7 +18,14 @@ namespace build2
flush ()
{
if (state_ == state::write)
+ try
+ {
os_.flush ();
+ }
+ catch (const io_error& e)
+ {
+ fail << "unable to flush " << path << ": " << e;
+ }
}
inline bool depdb::