return false;
for (int i = 0; list[i]; i++)
- if (strcmp(list[i], entry) == 0)
+ if (strequal(list[i], entry))
return true;
return false;
* from cgroup to cgroup2.
*/
if (pure_unified_layout(ops)) {
- if (strcmp(controller, "devices") == 0) {
+ if (strequal(controller, "devices")) {
if (ops->unified->bpf_device_controller)
return ops->unified;
break;
- } else if (strcmp(controller, "freezer") == 0) {
+ } else if (strequal(controller, "freezer")) {
if (ops->unified->freezer_controller)
return ops->unified;
tmp[len] = '\0';
lxc_iterate_parts(tok, tmp, ",")
- if (strcmp(tok, c) == 0)
+ if (strequal(tok, c))
return true;
return false;
int count, ret;
char temp[50];
- if (strcmp("devices.allow", key) == 0)
+ if (strequal("devices.allow", key))
device->allow = 1;
else
device->allow = 0;
- if (strcmp(val, "a") == 0) {
+ if (strequal(val, "a")) {
/* global rule */
device->type = 'a';
device->major = -1;
if (p)
*p = '\0';
- if (pure_unified_layout(ops) && strcmp(controller, "devices") == 0) {
+ if (pure_unified_layout(ops) && strequal(controller, "devices")) {
struct device_item device = {};
ret = device_cgroup_rule_parse(&device, key, value);
if (p)
*p = '\0';
- if (strcmp("devices.allow", filename) == 0 && value[0] == '/') {
+ if (strequal("devices.allow", filename) && value[0] == '/') {
int ret;
ret = convert_devpath(value, converted_value);
struct device_item device_item = {};
int ret;
- if (strcmp("devices.allow", key) == 0 && *val == '/')
+ if (strequal("devices.allow", key) && *val == '/')
ret = device_cgroup_rule_parse_devpath(&device_item, val);
else
ret = device_cgroup_rule_parse(&device_item, key, val);
bool found = false;
for (char **cur_use = ops->cgroup_use; cur_use && *cur_use; cur_use++) {
- if (strcmp(*cur_use, *cur_ctrl) != 0)
+ if (!strequal(*cur_use, *cur_ctrl))
continue;
found = true;
* We always need to chown this for both cgroup and
* cgroup2.
*/
- if (strcmp(token, "cgroup.procs") == 0)
+ if (strequal(token, "cgroup.procs"))
continue;
idx = append_null_to_list((void ***)delegate);
/* copy system-wide cgroup information */
cgroup_pattern = lxc_global_config_value("lxc.cgroup.pattern");
- if (cgroup_pattern && strcmp(cgroup_pattern, "") != 0)
+ if (cgroup_pattern && !strequal(cgroup_pattern, ""))
ops->cgroup_pattern = must_copy_string(cgroup_pattern);
return 0;