cgroups/devices: do not log error when bpf device feature is not available

parent 29b785e0
......@@ -511,23 +511,20 @@ bool bpf_devices_cgroup_supported(void)
int ret;
if (geteuid() != 0)
return log_error_errno(false,
EINVAL, "The bpf device cgroup requires real root");
return log_trace(false,
"The bpf device cgroup requires real root");
prog = bpf_program_new(BPF_PROG_TYPE_CGROUP_DEVICE);
if (prog < 0)
return log_error_errno(false,
errno, "Failed to allocate new bpf device cgroup program");
return log_trace(false, "Failed to allocate new bpf device cgroup program");
ret = bpf_program_add_instructions(prog, dummy, ARRAY_SIZE(dummy));
if (ret < 0)
return log_error_errno(false,
errno, "Failed to add new instructions to bpf device cgroup program");
return log_trace(false, "Failed to add new instructions to bpf device cgroup program");
ret = bpf_program_load_kernel(prog, NULL, 0);
if (ret < 0)
return log_error_errno(false,
errno, "Failed to load new bpf device cgroup program");
return log_trace(false, "Failed to load new bpf device cgroup program");
return log_trace(true, "The bpf device cgroup is supported");
}
......
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