summaryrefslogtreecommitdiff
path: root/src/api.c
diff options
context:
space:
mode:
authorPaul Moore <pmoore@redhat.com>2013-11-12 15:14:41 -0500
committerPaul Moore <pmoore@redhat.com>2013-11-12 15:14:41 -0500
commit053bcac036c09966f6b2c8aba38fbcdd3209b63f (patch)
treef45f9908a35e0f1775ecc92fe06fc8bb5033f6bd /src/api.c
parent2537127be66891fd42392b581518ad44da6fd6b4 (diff)
downloadlibseccomp-053bcac036c09966f6b2c8aba38fbcdd3209b63f.tar.gz
api: ensure we return the proper error codes in the syscall resolver functions
At some point we may want to expand __NR_SCMP_ERROR out to different error codes, but for right now this seems okay. Reported-by: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Paul Moore <pmoore@redhat.com>
Diffstat (limited to 'src/api.c')
-rw-r--r--src/api.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/api.c b/src/api.c
index 86e5f9d..198eb4e 100644
--- a/src/api.c
+++ b/src/api.c
@@ -286,15 +286,15 @@ API int seccomp_syscall_resolve_name_arch(uint32_t arch_token, const char *name)
const struct arch_def *arch;
if (name == NULL)
- return -EINVAL;
+ return __NR_SCMP_ERROR;
if (arch_token == 0)
arch_token = arch_def_native->token;
if (arch_valid(arch_token))
- return -EINVAL;
+ return __NR_SCMP_ERROR;
arch = arch_def_lookup(arch_token);
if (arch == NULL)
- return -EFAULT;
+ return __NR_SCMP_ERROR;
return arch_syscall_resolve_name(arch, name);
}