diff options
author | Zhangjin Wu <falcon@tinylab.org> | 2023-07-26 00:43:36 +0800 |
---|---|---|
committer | Willy Tarreau <w@1wt.eu> | 2023-08-23 05:17:07 +0200 |
commit | e7d0129df681aa23bb6528f44186accc38d655f0 (patch) | |
tree | 629d2d4f24f7eb8fa0613bbff68a0b97e11df6a0 /tools | |
parent | 447e56023fc281c588e4977add552f4d49d78b22 (diff) |
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 <falcon@tinylab.org>
Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/nolibc/nolibc-test.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index 3f5a256631ca..4d39823a567e 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; } |