From 795551059c51db5d36ae0c96a7eb51a5a70fe623 Mon Sep 17 00:00:00 2001 From: Luca Guerra Date: Mon, 22 Jul 2024 15:31:46 +0000 Subject: [PATCH] cleanup(libsinsp): remove unreachable code Signed-off-by: Luca Guerra --- userspace/libsinsp/utils.cpp | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/userspace/libsinsp/utils.cpp b/userspace/libsinsp/utils.cpp index 0bb4ea2e0e..a22ad1bc48 100644 --- a/userspace/libsinsp/utils.cpp +++ b/userspace/libsinsp/utils.cpp @@ -53,7 +53,6 @@ limitations under the License. #include #include #include -#include #ifndef PATH_MAX #define PATH_MAX 4096 @@ -595,23 +594,6 @@ bool sinsp_utils::sockinfo_to_str(sinsp_sockinfo* sinfo, scap_fd_type stype, cha return true; } -std::filesystem::path workaround_win_root_name(std::filesystem::path p) -{ - if (!p.has_root_name()) - { - return p; - } - - if (p.root_name().string().rfind("//", 0) == 0) - { - // this is something like //dir/hello. Add a leading slash to identify an absolute path rooted at / - return std::filesystem::path("/" + p.string()); - } - - // last case: this is a relative path, like c:/dir/hello. Add a leading ./ to identify a relative path - return std::filesystem::path("./" + p.string()); -} - // // Helper function to move a directory up in a path string //