cgroups/devices: use dedicated enums

parent aa29c0bd
......@@ -447,7 +447,8 @@ int bpf_list_add_device(struct lxc_conf *conf, struct device_item *device)
lxc_list_for_each(it, &conf->devices) {
struct device_item *cur = it->elem;
if (cur->global_rule != -1 && device->global_rule != -1) {
if (cur->global_rule > LXC_BPF_DEVICE_CGROUP_LOCAL_RULE &&
device->global_rule > LXC_BPF_DEVICE_CGROUP_LOCAL_RULE) {
TRACE("Switched from %s to %s",
cur->global_rule == LXC_BPF_DEVICE_CGROUP_WHITELIST
? "whitelist"
......
......@@ -224,9 +224,9 @@ struct lxc_state_client {
};
enum {
LXC_BPF_DEVICE_CGROUP_LOCAL_RULE = -1,
LXC_BPF_DEVICE_CGROUP_WHITELIST = 0,
LXC_BPF_DEVICE_CGROUP_BLACKLIST = 1,
LXC_BPF_DEVICE_CGROUP_LOCAL_RULE = -1,
};
struct device_item {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment