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/filesystem.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'build2/filesystem.cxx') diff --git a/build2/filesystem.cxx b/build2/filesystem.cxx index 97f540b..5e6df5f 100644 --- a/build2/filesystem.cxx +++ b/build2/filesystem.cxx @@ -27,6 +27,20 @@ namespace build2 } } + timestamp + mtime (const char* p) + { + try + { + return file_mtime (p); + } + catch (const system_error& e) + { + fail << "unable to obtain file " << p << " modification time: " << e + << endf; + } + } + fs_status mkdir (const dir_path& d, uint16_t v) { -- cgit v1.1