aboutsummaryrefslogtreecommitdiff
path: root/build2/cc
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-04-03 21:19:50 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-04-03 21:24:46 +0300
commit6e126ac30038502acf7016f0e76b3183f1304042 (patch)
tree0db3f56340e8c55a559e96762742ec925dbca68d /build2/cc
parenta797f6dd584c6f25bac7b0ed122ea7d1d9a42684 (diff)
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.
Diffstat (limited to 'build2/cc')
-rw-r--r--build2/cc/common.cxx6
-rw-r--r--build2/cc/compile-rule.cxx3
-rw-r--r--build2/cc/link-rule.cxx4
-rw-r--r--build2/cc/msvc.cxx2
-rw-r--r--build2/cc/pkgconfig.cxx2
-rw-r--r--build2/cc/windows-rpath.cxx4
6 files changed, 11 insertions, 10 deletions
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 <build2/context.hxx>
#include <build2/variable.hxx>
#include <build2/algorithm.hxx>
+#include <build2/filesystem.hxx> // mtime()
#include <build2/diagnostics.hxx>
#include <build2/bin/target.hxx>
@@ -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;
}