libprocessgroup: Convert CGROUPV2_HIERARCHY_NAME to std::string
Almost everywhere CGROUPV2_HIERARCHY_NAME is used a std::string is required, so change its type to avoid temporaries. Change-Id: I4466838c510f2eb8212fc71999cdaa47359ce9c3
This commit is contained in:
parent
9e5f74d4e4
commit
b6071f19c3
2 changed files with 2 additions and 2 deletions
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
|
|
||||||
static constexpr const char* CGROUPV2_HIERARCHY_NAME = "cgroup2";
|
static constexpr std::string CGROUPV2_HIERARCHY_NAME = "cgroup2";
|
||||||
|
|
||||||
bool CgroupsAvailable();
|
bool CgroupsAvailable();
|
||||||
bool CgroupGetControllerPath(const std::string& cgroup_name, std::string* path);
|
bool CgroupGetControllerPath(const std::string& cgroup_name, std::string* path);
|
||||||
|
|
|
||||||
|
|
@ -222,7 +222,7 @@ static bool SetupCgroup(const CgroupDescriptor& descriptor) {
|
||||||
const CgroupController* controller = descriptor.controller();
|
const CgroupController* controller = descriptor.controller();
|
||||||
|
|
||||||
if (controller->version() == 2) {
|
if (controller->version() == 2) {
|
||||||
if (!strcmp(controller->name(), CGROUPV2_HIERARCHY_NAME)) {
|
if (controller->name() == CGROUPV2_HIERARCHY_NAME) {
|
||||||
return MountV2CgroupController(descriptor);
|
return MountV2CgroupController(descriptor);
|
||||||
} else {
|
} else {
|
||||||
return ActivateV2CgroupController(descriptor);
|
return ActivateV2CgroupController(descriptor);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue