as reported by Jane Lv, mmap() returns an unsigned value (MAP_FAILED) upon error, so checking with <= 0 will not work
diff --git a/testcases/kernel/syscalls/truncate/truncate03.c b/testcases/kernel/syscalls/truncate/truncate03.c
index 43bbf3f..ca983d8 100644
--- a/testcases/kernel/syscalls/truncate/truncate03.c
+++ b/testcases/kernel/syscalls/truncate/truncate03.c
@@ -292,7 +292,7 @@
bad_addr = mmap(0, 1, PROT_NONE,
MAP_PRIVATE_EXCEPT_UCLINUX|MAP_ANONYMOUS, 0, 0);
- if (bad_addr <= 0) {
+ if (bad_addr == MAP_FAILED) {
tst_brkm(TBROK, cleanup, "mmap failed");
}
Test_cases[3].pathname = bad_addr;