summaryrefslogtreecommitdiff
path: root/src/core/restrict-ifaces.c
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2022-03-15 17:14:19 +0000
committerDaan De Meyer <daan.j.demeyer@gmail.com>2022-03-15 17:14:19 +0000
commitcc20479f422d0b10556c2636ae60f7c9483094f8 (patch)
treeaa3043704ca0a1d1e07b60dace82e391121f036d /src/core/restrict-ifaces.c
parent8f048bb76a350473fb81a4a100aa5aafa7d3f824 (diff)
downloadsystemd-cc20479f422d0b10556c2636ae60f7c9483094f8.tar.gz
bpf: Fix error handling
The __open() functions actually set errno on failure so let's update the error handling to account for that.
Diffstat (limited to 'src/core/restrict-ifaces.c')
-rw-r--r--src/core/restrict-ifaces.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/core/restrict-ifaces.c b/src/core/restrict-ifaces.c
index 00dc429078..efa5c8d85a 100644
--- a/src/core/restrict-ifaces.c
+++ b/src/core/restrict-ifaces.c
@@ -34,8 +34,7 @@ static int prepare_restrict_ifaces_bpf(
obj = restrict_ifaces_bpf__open();
if (!obj)
- return log_unit_full_errno(u, u ? LOG_ERR : LOG_DEBUG,
- SYNTHETIC_ERRNO(ENOMEM), "Failed to open BPF object");
+ return log_unit_full_errno(u, u ? LOG_ERR : LOG_DEBUG, errno, "Failed to open BPF object: %m");
r = sym_bpf_map__resize(obj->maps.sd_restrictif, MAX(set_size(restrict_network_interfaces), 1u));
if (r != 0)