]> granicus.if.org Git - strace/commitdiff
tests: workaround systemd-nspawn habit of disabling mlockall syscall
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 22 Aug 2018 20:38:27 +0000 (20:38 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 22 Aug 2018 20:38:27 +0000 (20:38 +0000)
* tests/mmap.c (main): Do not assume that mlockall syscall always
succeeds.

tests/mmap.c

index e9f587ec0969033aae535720a1011a04324ea817..f797e68522fe3fb1ec98fccceb251d7d7aae44f9 100644 (file)
@@ -140,15 +140,15 @@ main(int ac, char **av)
                perror_msg_and_fail("munmap");
        printf("munmap(%p, %lu) = 0\n", p, length3);
 
-       if (mlockall(MCL_FUTURE))
-               perror_msg_and_fail("mlockall");
+       printf("mlockall(");
 #if XLAT_RAW
-       printf("mlockall(%#x) = 0\n", MCL_FUTURE);
+       printf("%#x", MCL_FUTURE);
 #elif XLAT_VERBOSE
-       printf("mlockall(%#x /* MCL_FUTURE */) = 0\n", MCL_FUTURE);
+       printf("%#x /* MCL_FUTURE */", MCL_FUTURE);
 #else
-       puts("mlockall(MCL_FUTURE) = 0");
+       printf("MCL_FUTURE");
 #endif
+       printf(") = %s\n", sprintrc(mlockall(MCL_FUTURE)));
 
        puts("+++ exited with 0 +++");
        return 0;