From: Paul Moore Date: Tue, 5 Nov 2019 20:11:11 +0000 (-0500) Subject: tests: rely on __SNR_xxx instead of __NR_xxx for syscalls X-Git-Tag: archive/raspbian/2.4.2-2+rpi1^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=afa79a8221ac2acc3c620c2fe0f77980e1a6e910;p=libseccomp.git tests: rely on __SNR_xxx instead of __NR_xxx for syscalls We recently changed how libseccomp handles syscall numbers that are not defined natively, but we missed test #15. Signed-off-by: Paul Moore Note: Tagged for v2.5, but needed to build 2.4.2 with newer kernels on arm This is part of PR: https://github.com/seccomp/libseccomp/pull/182 Upstream Bug: https://github.com/seccomp/libseccomp/issues/184 Origin: upstream, https://github.com/pcmoore/misc-libseccomp/commit/35803ceb43c453762a3ab5177c5f8d5dbb813478 Bug-Ubuntu: https://bugs.launchpad.net/bugs/1849785 Last-Update: 2019-11-12 Gbp-Pq: Name tests-rely-on-__SNR_xxx-instead-of-__NR_xxx-for-sysc.patch --- diff --git a/tests/15-basic-resolver.c b/tests/15-basic-resolver.c index 6badef1..0c1eefe 100644 --- a/tests/15-basic-resolver.c +++ b/tests/15-basic-resolver.c @@ -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) {