From 54f2397c84f18a666d9e300f342141caf79c2a61 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Wed, 28 Dec 2016 22:33:38 +0000 Subject: [PATCH] tests: enhance invalid address decoding check in seccomp-strict.test * tests/seccomp-strict.c (main): Change the type of addr variable containg the invalid address from unsigned long to kernel_ulong_t, print it using %#llx format. --- tests/seccomp-strict.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/seccomp-strict.c b/tests/seccomp-strict.c index 47d909d5..237b0eca 100644 --- a/tests/seccomp-strict.c +++ b/tests/seccomp-strict.c @@ -41,18 +41,18 @@ main(void) static const char text1[] = "seccomp(SECCOMP_SET_MODE_STRICT, 0, NULL) = 0\n"; static const char text2[] = "+++ exited with 0 +++\n"; - const unsigned long addr = (unsigned long) 0xfacefeeddeadbeef; + const kernel_ulong_t addr = (kernel_ulong_t) 0xfacefeeddeadbeefULL; long rc; rc = syscall(__NR_seccomp, -1L, -1L, addr); - printf("seccomp(%#x /* SECCOMP_SET_MODE_??? */, %u, %#lx)" - " = %ld %s (%m)\n", -1, -1, addr, rc, errno2name()); + printf("seccomp(%#x /* SECCOMP_SET_MODE_??? */, %u, %#llx)" + " = %s\n", -1, -1, (unsigned long long) addr, sprintrc(rc)); fflush(stdout); rc = syscall(__NR_seccomp, 0, 0, 0); if (rc) { - printf("seccomp(SECCOMP_SET_MODE_STRICT, 0, NULL)" - " = %ld %s (%m)\n", rc, errno2name()); + printf("seccomp(SECCOMP_SET_MODE_STRICT, 0, NULL) = %s\n", + sprintrc(rc)); fflush(stdout); rc = 0; } else {