From: Zhangjin Wu Date: Tue, 25 Jul 2023 16:43:36 +0000 (+0800) Subject: selftests/nolibc: mmap_munmap_good: fix up return value X-Git-Tag: v6.6.17~4111^2~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e7d0129df681aa23bb6528f44186accc38d655f0;p=platform%2Fkernel%2Flinux-rpi.git selftests/nolibc: mmap_munmap_good: fix up return value The other tests use 1 as failure, mmap_munmap_good uses -1 as failure, let's fix up this. Signed-off-by: Zhangjin Wu Reviewed-by: Thomas Weißschuh Signed-off-by: Willy Tarreau --- diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index 3f5a256..4d39823 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -726,7 +726,7 @@ int test_mmap_munmap(void) page_size = getpagesize(); if (page_size < 0) - return -1; + return 1; /* find a right file to mmap, existed and accessible */ for (i = 0; files[i] != NULL; i++) { @@ -737,7 +737,7 @@ int test_mmap_munmap(void) break; } if (ret == -1) - return ret; + return 1; ret = stat(files[i], &stat_buf); if (ret == -1) @@ -757,7 +757,7 @@ int test_mmap_munmap(void) mem = mmap(NULL, length + offset - pa_offset, PROT_READ, MAP_SHARED, fd, pa_offset); if (mem == MAP_FAILED) { - ret = -1; + ret = 1; goto end; } @@ -765,7 +765,7 @@ int test_mmap_munmap(void) end: close(fd); - return ret; + return !!ret; }