]> granicus.if.org Git - strace/commitdiff
tests: enhance invalid address decoding check in seccomp-strict.test
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 28 Dec 2016 22:33:38 +0000 (22:33 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 28 Dec 2016 22:33:38 +0000 (22:33 +0000)
* 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

index 47d909d5a3499ace6863634b57a8dfec4907a278..237b0ecacf65cb0bd11aa8af6dd47a5e460c82a1 100644 (file)
@@ -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 {