ucode-mod-bpf: fix stale errno when rodata map is missing
bpf_object__next_map does not set errno when it runs out of maps, so the reported error code was whatever errno happened to hold. With errno 0 the failure was invisible to error(). Report ENOENT instead. Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
@@ -129,7 +129,7 @@ uc_bpf_module_set_opts(struct bpf_object *obj, uc_value_t *opts)
|
||||
}
|
||||
|
||||
if (!map)
|
||||
err_return_int(errno, "rodata map");
|
||||
err_return_int(ENOENT, "rodata map");
|
||||
|
||||
if (bpf_map__set_initial_value(map, ucv_string_get(val),
|
||||
ucv_string_length(val)))
|
||||
|
||||
Reference in New Issue
Block a user