aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric B Munson <emunson@mgebm.net>2011-01-04 09:25:34 -0700
committerEric B Munson <emunson@mgebm.net>2011-01-21 14:09:27 -0700
commit1fb91f1092771a5ae91179ef5b5a9174b3222c69 (patch)
tree0bc2cd8e8f397c504a7a76f63838a589eae6b2e4
parent433d6c777dff1f96718b5f92e7e7957989b0860b (diff)
downloadlibhugetlbfs-1fb91f1092771a5ae91179ef5b5a9174b3222c69.tar.gz
Store return value of ftruncate in icache-hygiene
When warn_unused_result is enabled there are several warnings about ignored return values of ftruncate in the icache-hygiene test. This patch contiunues to ignore the return value but stores it to quiet the compiler. Signed-off-by: Eric B Munson <emunson@mgebm.net>
-rw-r--r--tests/icache-hygiene.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/icache-hygiene.c b/tests/icache-hygiene.c
index 399d511..eb64a62 100644
--- a/tests/icache-hygiene.c
+++ b/tests/icache-hygiene.c
@@ -142,12 +142,13 @@ static void sig_handler(int signum, siginfo_t *si, void *uc)
static void test_once(int fd)
{
void *p, *q;
+ int dummy;
- ftruncate(fd, 0);
+ dummy = ftruncate(fd, 0);
if (sigsetjmp(sig_escape, 1)) {
sig_expected = NULL;
- ftruncate(fd, 0);
+ dummy = ftruncate(fd, 0);
return;
}
@@ -156,13 +157,13 @@ static void test_once(int fd)
if (p == MAP_FAILED)
FAIL("mmap() 1: %s", strerror(errno));
- ftruncate(fd, hpage_size);
+ dummy = ftruncate(fd, hpage_size);
q = p + hpage_size - COPY_SIZE;
jumpfunc(1, q);
- ftruncate(fd, 0);
+ dummy = ftruncate(fd, 0);
p = mmap(p, hpage_size, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_SHARED|MAP_FIXED, fd, 0);
if (p == MAP_FAILED)