fix build

This commit is contained in:
Nikita Taranov 2024-08-13 16:13:25 +01:00
parent 05b5950948
commit b5134fd490
2 changed files with 6 additions and 2 deletions

View File

@ -51,8 +51,9 @@ fs::path cgroupV2PathOfProcess()
#endif
}
std::optional<std::string> getCgroupsV2PathContainingFile(std::string_view file_name)
std::optional<std::string> getCgroupsV2PathContainingFile([[maybe_unused]] std::string_view file_name)
{
#if defined(OS_LINUX)
if (!cgroupsV2Enabled())
return {};
@ -70,4 +71,7 @@ std::optional<std::string> getCgroupsV2PathContainingFile(std::string_view file_
current_cgroup = current_cgroup.parent_path();
}
return {};
#else
return {};
#endif
}

View File

@ -19,4 +19,4 @@ std::filesystem::path cgroupV2PathOfProcess();
/// Returns the most nested cgroup dir containing the specified file.
/// If cgroups v2 is not enabled - returns an empty optional.
std::optional<std::string> getCgroupsV2PathContainingFile(std::string_view file_name);
std::optional<std::string> getCgroupsV2PathContainingFile([[maybe_unused]] std::string_view file_name);