Skip to content

Commit

Permalink
tests: rely on __SNR_xxx instead of __NR_xxx for syscalls
Browse files Browse the repository at this point in the history
We recently changed how libseccomp handles syscall numbers that are
not defined natively, but we missed test #15.

Acked-by: Tom Hromatka <[email protected]>
Signed-off-by: Paul Moore <[email protected]>
  • Loading branch information
pcmoore committed Nov 20, 2019
1 parent c7d80ed commit 1ecdddb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/15-basic-resolver.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ int main(int argc, char *argv[])
unsigned int arch;
char *name = NULL;

if (seccomp_syscall_resolve_name("open") != __NR_open)
if (seccomp_syscall_resolve_name("open") != __SNR_open)
goto fail;
if (seccomp_syscall_resolve_name("read") != __NR_read)
if (seccomp_syscall_resolve_name("read") != __SNR_read)
goto fail;
if (seccomp_syscall_resolve_name("INVALID") != __NR_SCMP_ERROR)
goto fail;

rc = seccomp_syscall_resolve_name_rewrite(SCMP_ARCH_NATIVE, "openat");
if (rc != __NR_openat)
if (rc != __SNR_openat)
goto fail;

while ((arch = arch_list[iter++]) != -1) {
Expand Down

0 comments on commit 1ecdddb

Please sign in to comment.