aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/target.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-12-08 21:13:47 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-12-12 18:28:02 +0300
commitab7dba520c8efd2cfbdd71dd91ae6b60923a12cd (patch)
treebb4cf6a252397c5aa1f0cf9ef7a3ab064b6079e6 /libbuild2/target.cxx
parentaeae50fe987b1787d1c1ae6f5c0bfb4f179205ef (diff)
Adapt to dir_iterator API change
Diffstat (limited to 'libbuild2/target.cxx')
-rw-r--r--libbuild2/target.cxx24
1 files changed, 22 insertions, 2 deletions
diff --git a/libbuild2/target.cxx b/libbuild2/target.cxx
index 76d45c7..16aec49 100644
--- a/libbuild2/target.cxx
+++ b/libbuild2/target.cxx
@@ -1253,7 +1253,7 @@ namespace build2
{
try
{
- for (const dir_entry& e: dir_iterator (d, true /* ignore_dangling */))
+ for (const dir_entry& e: dir_iterator (d, dir_iterator::detect_dangling))
{
switch (e.type ())
{
@@ -1271,6 +1271,16 @@ namespace build2
break;
}
+ case entry_type::unknown:
+ {
+ bool sl (e.ltype () == entry_type::symlink);
+
+ warn << "skipping "
+ << (sl ? "dangling symlink" : "inaccessible entry") << ' '
+ << d / e.path ();
+
+ break;
+ }
default:
break;
}
@@ -1292,9 +1302,10 @@ namespace build2
try
{
- for (const dir_entry& e: dir_iterator (d, true /* ignore_dangling */))
+ for (const dir_entry& e: dir_iterator (d, dir_iterator::detect_dangling))
{
if (e.type () == entry_type::directory)
+ {
r.push_back (
prerequisite (nullopt,
dir::static_type,
@@ -1303,6 +1314,15 @@ namespace build2
string (),
nullopt,
bs));
+ }
+ else if (e.type () == entry_type::unknown)
+ {
+ bool sl (e.ltype () == entry_type::symlink);
+
+ warn << "skipping "
+ << (sl ? "dangling symlink" : "inaccessible entry") << ' '
+ << d / e.path ();
+ }
}
}
catch (const system_error& e)