Commit e7d0129d authored by Zhangjin Wu's avatar Zhangjin Wu Committed by Willy Tarreau

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: default avatarZhangjin Wu <falcon@tinylab.org>
Reviewed-by: default avatarThomas Weißschuh <linux@weissschuh.net>
Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
parent 447e5602
...@@ -726,7 +726,7 @@ int test_mmap_munmap(void) ...@@ -726,7 +726,7 @@ int test_mmap_munmap(void)
page_size = getpagesize(); page_size = getpagesize();
if (page_size < 0) if (page_size < 0)
return -1; return 1;
/* find a right file to mmap, existed and accessible */ /* find a right file to mmap, existed and accessible */
for (i = 0; files[i] != NULL; i++) { for (i = 0; files[i] != NULL; i++) {
...@@ -737,7 +737,7 @@ int test_mmap_munmap(void) ...@@ -737,7 +737,7 @@ int test_mmap_munmap(void)
break; break;
} }
if (ret == -1) if (ret == -1)
return ret; return 1;
ret = stat(files[i], &stat_buf); ret = stat(files[i], &stat_buf);
if (ret == -1) if (ret == -1)
...@@ -757,7 +757,7 @@ int test_mmap_munmap(void) ...@@ -757,7 +757,7 @@ int test_mmap_munmap(void)
mem = mmap(NULL, length + offset - pa_offset, PROT_READ, MAP_SHARED, fd, pa_offset); mem = mmap(NULL, length + offset - pa_offset, PROT_READ, MAP_SHARED, fd, pa_offset);
if (mem == MAP_FAILED) { if (mem == MAP_FAILED) {
ret = -1; ret = 1;
goto end; goto end;
} }
...@@ -765,7 +765,7 @@ int test_mmap_munmap(void) ...@@ -765,7 +765,7 @@ int test_mmap_munmap(void)
end: end:
close(fd); close(fd);
return ret; return !!ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment