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/cc/common.cxx | 6 +++--- build2/cc/compile-rule.cxx | 3 ++- build2/cc/link-rule.cxx | 4 ++-- build2/cc/msvc.cxx | 2 +- build2/cc/pkgconfig.cxx | 2 +- build2/cc/windows-rpath.cxx | 4 ++-- 6 files changed, 11 insertions(+), 10 deletions(-) (limited to 'build2/cc') diff --git a/build2/cc/common.cxx b/build2/cc/common.cxx index 7844a4e..aca1240 100644 --- a/build2/cc/common.cxx +++ b/build2/cc/common.cxx @@ -639,7 +639,7 @@ namespace build2 { f = d; f /= sn; - mt = file_mtime (f); + mt = mtime (f); if (mt != timestamp_nonexistent) { @@ -694,7 +694,7 @@ namespace build2 // se = string ("dll"); f = f.base (); // Remove .a from .dll.a. - mt = file_mtime (f); + mt = mtime (f); if (mt != timestamp_nonexistent) { @@ -715,7 +715,7 @@ namespace build2 f = d; f /= an; - if ((mt = file_mtime (f)) != timestamp_nonexistent) + if ((mt = mtime (f)) != timestamp_nonexistent) { // Enter the target. Note that because the search paths are // normalized, the result is automatically normalized as well. diff --git a/build2/cc/compile-rule.cxx b/build2/cc/compile-rule.cxx index eeaec83..aa1d6fb 100644 --- a/build2/cc/compile-rule.cxx +++ b/build2/cc/compile-rule.cxx @@ -13,6 +13,7 @@ #include #include #include +#include // mtime() #include #include @@ -823,7 +824,7 @@ namespace build2 // the target (interrupted update), then do unconditional update. // timestamp mt; - bool u (dd.writing () || dd.mtime > (mt = file_mtime (tp))); + bool u (dd.writing () || dd.mtime > (mt = mtime (tp))); if (u) mt = timestamp_nonexistent; // Treat as if it doesn't exist. diff --git a/build2/cc/link-rule.cxx b/build2/cc/link-rule.cxx index 6c6aa0d..cffd731 100644 --- a/build2/cc/link-rule.cxx +++ b/build2/cc/link-rule.cxx @@ -1689,7 +1689,7 @@ namespace build2 path& mf (p.first); bool mf_cf (p.second); // Changed flag (timestamp resolution). - timestamp mf_mt (file_mtime (mf)); + timestamp mf_mt (mtime (mf)); if (tsys == "mingw32") { @@ -1699,7 +1699,7 @@ namespace build2 // manifest = mf + ".o"; - if (mf_mt > file_mtime (manifest) || mf_cf) + if (mf_mt > mtime (manifest) || mf_cf) { path of (relative (manifest)); diff --git a/build2/cc/msvc.cxx b/build2/cc/msvc.cxx index 78c29e0..32805c7 100644 --- a/build2/cc/msvc.cxx +++ b/build2/cc/msvc.cxx @@ -396,7 +396,7 @@ namespace build2 // Check if the file exists and is of the expected type. // - timestamp mt (file_mtime (f)); + timestamp mt (mtime (f)); if (mt != timestamp_nonexistent && library_type (ld, f) == lt) { diff --git a/build2/cc/pkgconfig.cxx b/build2/cc/pkgconfig.cxx index 3e477d8..eef1271 100644 --- a/build2/cc/pkgconfig.cxx +++ b/build2/cc/pkgconfig.cxx @@ -1178,7 +1178,7 @@ namespace build2 // that, if we add it as a prerequisite (like we do above), the fallback // file rule won't match. // - lt.mtime (file_mtime (ipc.path)); + lt.mtime (mtime (ipc.path)); } #else diff --git a/build2/cc/windows-rpath.cxx b/build2/cc/windows-rpath.cxx index 8161cc4..46fe75b 100644 --- a/build2/cc/windows-rpath.cxx +++ b/build2/cc/windows-rpath.cxx @@ -102,7 +102,7 @@ namespace build2 // timestamp t (l != nullptr ? l->load_mtime () - : file_mtime (f.c_str ())); + : mtime (f.c_str ())); if (t > r) r = t; @@ -260,7 +260,7 @@ namespace build2 // through the "from scratch" update. Actually this can happen when // switching to update-for-install. // - if (ts != timestamp_nonexistent && ts <= file_mtime (am)) + if (ts != timestamp_nonexistent && ts <= mtime (am)) return; } -- cgit v1.1