if (strv_isempty(l))
c->syscall_archs = set_free(c->syscall_archs);
- else
- STRV_FOREACH(s, l) {
- uint32_t a;
-
- r = seccomp_arch_from_string(*s, &a);
- if (r < 0)
- return r;
-
- r = set_ensure_put(&c->syscall_archs, NULL, UINT32_TO_PTR(a + 1));
- if (r < 0)
- return r;
- }
+ else {
+ r = parse_syscall_archs(l, &c->syscall_archs);
+ if (r < 0)
+ return r;
+ }
joined = strv_join(l, " ");
if (!joined)
return 0;
}
-int parse_syscall_archs(char **l, Set **ret_archs) {
- _cleanup_set_free_ Set *archs = NULL;
+int parse_syscall_archs(char **l, Set **archs) {
int r;
assert(l);
- assert(ret_archs);
+ assert(archs);
STRV_FOREACH(s, l) {
uint32_t a;
if (r < 0)
return -EINVAL;
- r = set_ensure_put(&archs, NULL, UINT32_TO_PTR(a + 1));
+ r = set_ensure_put(archs, NULL, UINT32_TO_PTR(a + 1));
if (r < 0)
return -ENOMEM;
}
- *ret_archs = TAKE_PTR(archs);
return 0;
}