Skip to content

Commit

Permalink
fix(cmake): patch libs to list-views correctly
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
  • Loading branch information
therealbobo committed Feb 15, 2024
1 parent e165210 commit 07ed12d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmake/modules/falcosecurity-libs-repo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ ExternalProject_Add(
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND "")
TEST_COMMAND ""
PATCH_COMMAND sh -c "patch -p1 <${CMAKE_SOURCE_DIR}/chisel.patch"
)
17 changes: 17 additions & 0 deletions cmake/modules/falcosecurity-libs-repo/chisel.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/userspace/chisel/chisel.cpp b/userspace/chisel/chisel.cpp
index ba01ba9dd..0927372fc 100644
--- a/userspace/chisel/chisel.cpp
+++ b/userspace/chisel/chisel.cpp
@@ -1090,9 +1090,10 @@ void sinsp_chisel::get_chisel_list(vector<chisel_desc>* chisel_descs)
continue;
}

- for (auto const& dir_entry : filesystem::directory_iterator(dir_info.m_dir))
+ std::error_code ec;
+ for (auto const& dir_entry : filesystem::directory_iterator(dir_info.m_dir, ec))
{
- if(dir_entry.path().extension() == ".lua")
+ if(!ec && dir_entry.path().extension() == ".lua")
{
auto res = find_if(chisel_descs->begin(), chisel_descs->end(),
[&dir_entry](auto& desc) { return dir_entry.path().filename() == desc.m_name; });

0 comments on commit 07ed12d

Please sign in to comment.