aboutsummaryrefslogtreecommitdiff
path: root/build2/file.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2016-09-09 18:29:37 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2016-09-13 13:03:19 +0300
commitdc1b424b75f200a716c3bd9b91891cf7f818ad32 (patch)
tree6c1625d8a52ad7ddc642da72f3c1f8896b617ff2 /build2/file.cxx
parentc49a4f0aeefd04ea6a269693d47d1e9d91ed8ad7 (diff)
Fix crashing on unhandled system_error thrown by file_exists()
Diffstat (limited to 'build2/file.cxx')
-rw-r--r--build2/file.cxx17
1 files changed, 8 insertions, 9 deletions
diff --git a/build2/file.cxx b/build2/file.cxx
index bf1c4d8..0040fd4 100644
--- a/build2/file.cxx
+++ b/build2/file.cxx
@@ -6,10 +6,9 @@
#include <iostream> // cin
-#include <butl/filesystem> // file_exists()
-
#include <build2/scope>
#include <build2/context>
+#include <build2/filesystem> // exists()
#include <build2/prerequisite>
#include <build2/diagnostics>
@@ -43,13 +42,13 @@ namespace build2
{
// @@ Can we have root without bootstrap? I don't think so.
//
- return file_exists (d / bootstrap_file) || file_exists (d / root_file);
+ return exists (d / bootstrap_file) || exists (d / root_file);
}
bool
is_out_root (const dir_path& d)
{
- return file_exists (d / src_root_file);
+ return exists (d / src_root_file);
}
dir_path
@@ -257,7 +256,7 @@ namespace build2
{
path bf (root.out_path () / src_root_file);
- if (!file_exists (bf))
+ if (!exists (bf))
return;
//@@ TODO: if bootstrap files can source other bootstrap files
@@ -335,7 +334,7 @@ namespace build2
{
path f (out_root / src_root_file);
- if (!fallback_src_root.empty () && !file_exists (f))
+ if (!fallback_src_root.empty () && !exists (f))
src_root = &fallback_src_root;
else
{
@@ -462,7 +461,7 @@ namespace build2
path bf (src_root / bootstrap_file);
- if (file_exists (bf))
+ if (exists (bf))
{
// We assume that bootstrap out cannot load this file explicitly. It
// feels wrong to allow this since that makes the whole bootstrap
@@ -575,7 +574,7 @@ namespace build2
//
subprojects sps;
- if (dir_exists (out_root))
+ if (exists (out_root))
{
l5 ([&]{trace << "looking for subprojects in " << out_root;});
find_subprojects (sps, out_root, out_root, true);
@@ -814,7 +813,7 @@ namespace build2
//
path bf (root.src_path () / root_file);
- if (file_exists (bf))
+ if (exists (bf))
source_once (bf, root, root);
}