From 6e126ac30038502acf7016f0e76b3183f1304042 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 3 Apr 2019 21:19:50 +0300 Subject: Change depdb API and handle system_error thrown by butl::file_mtime() Previously, debdb operations threw system_error and io_error to signal errors, except for opening which issued diagnostics and failed. Now all operations print the diagnostics and fail on system and IO errors. --- build2/depdb.cxx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'build2/depdb.cxx') diff --git a/build2/depdb.cxx b/build2/depdb.cxx index da56c8b..605ceb4 100644 --- a/build2/depdb.cxx +++ b/build2/depdb.cxx @@ -4,12 +4,11 @@ #include -#include // file_mtime() - #ifdef _WIN32 # include #endif +#include // mtime() #include using namespace std; @@ -91,7 +90,7 @@ namespace build2 depdb:: depdb (path_type p) - : depdb (move (p), file_mtime (p)) + : depdb (move (p), build2::mtime (p)) { } @@ -347,7 +346,7 @@ namespace build2 // mtime. This seems to force that layer to commit to a timestamp. // #if defined(__FreeBSD__) - mtime = file_mtime (path); // Save for debugging/check below. + mtime = build2::mtime (path); // Save for debugging/check below. #endif } @@ -357,8 +356,8 @@ namespace build2 // We could call the static version but then we would have lost additional // information for some platforms. // - timestamp t_mt (file_mtime (t)); - timestamp d_mt (file_mtime (path)); + timestamp t_mt (build2::mtime (t)); + timestamp d_mt (build2::mtime (path)); if (d_mt > t_mt) { @@ -382,8 +381,10 @@ namespace build2 const path_type& t, timestamp e) { - timestamp t_mt (file_mtime (t)); - timestamp d_mt (file_mtime (d)); + using build2::mtime; + + timestamp t_mt (mtime (t)); + timestamp d_mt (mtime (d)); if (d_mt > t_mt) { -- cgit v1.1