* [LTP] [PATCH v3] Clean up hugemmap02 testcase
@ 2016-02-17 8:22 shuang.qiu
2016-02-25 9:50 ` Alexey Kodanev
0 siblings, 1 reply; 2+ messages in thread
From: shuang.qiu @ 2016-02-17 8:22 UTC (permalink / raw)
To: ltp
From: Shuang Qiu <shuang.qiu@oracle.com>
* Remove continue in the loop because it skips the cleanup
* munmap() addr2 for 32-bit
* close nfildes fd in the end of loop
Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>
---
testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c
index 1a44993..d31609d 100644
--- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c
+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c
@@ -158,8 +158,6 @@ int main(int ac, char **av)
if (addr2 == MAP_FAILED) {
tst_resm(TFAIL | TERRNO, "huge mmap failed unexpectedly"
" with %s (64-bit)", TEMPFILE);
- close(fildes);
- continue;
} else {
tst_resm(TPASS, "huge mmap succeeded (64-bit)");
}
@@ -170,8 +168,6 @@ int main(int ac, char **av)
else if (addr2 > 0) {
tst_resm(TCONF,
"huge mmap failed to test the scenario");
- close(fildes);
- continue;
} else if (addr == 0)
tst_resm(TPASS, "huge mmap succeeded (32-bit)");
#endif
@@ -183,13 +179,12 @@ int main(int ac, char **av)
"munmap of addrlist[%d] failed", i);
}
-#if __WORDSIZE == 64
if (munmap(addr2, map_sz) == -1)
tst_brkm(TFAIL | TERRNO, NULL, "huge munmap failed");
-#endif
if (munmap(addr, page_sz) == -1)
tst_brkm(TFAIL | TERRNO, NULL, "munmap failed");
+ close(nfildes);
close(fildes);
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [LTP] [PATCH v3] Clean up hugemmap02 testcase
2016-02-17 8:22 [LTP] [PATCH v3] Clean up hugemmap02 testcase shuang.qiu
@ 2016-02-25 9:50 ` Alexey Kodanev
0 siblings, 0 replies; 2+ messages in thread
From: Alexey Kodanev @ 2016-02-25 9:50 UTC (permalink / raw)
To: ltp
Hi,
On 02/17/2016 11:22 AM, shuang.qiu@oracle.com wrote:
> From: Shuang Qiu <shuang.qiu@oracle.com>
>
> * Remove continue in the loop because it skips the cleanup
>
> * munmap() addr2 for 32-bit
>
> * close nfildes fd in the end of loop
>
Slightly changed the commit subject and applied.
Best regards,
Alexey
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-02-25 9:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-17 8:22 [LTP] [PATCH v3] Clean up hugemmap02 testcase shuang.qiu
2016-02-25 9:50 ` Alexey Kodanev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox