Skip to content

Commit

Permalink
cleanup(libsinsp): remove unreachable code
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Guerra <luca@guerra.sh>
  • Loading branch information
LucaGuerra authored and poiana committed Aug 5, 2024
1 parent 85320ef commit 9bda461
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions userspace/libsinsp/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ limitations under the License.
#include <cerrno>
#include <functional>
#include <sys/stat.h>
#include <filesystem>

#ifndef PATH_MAX
#define PATH_MAX 4096
Expand Down Expand Up @@ -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
//
Expand Down

0 comments on commit 9bda461

Please sign in to comment.