From 98127d2b408879ae71349dbb1e0a59cb7c2cce06 Mon Sep 17 00:00:00 2001 From: Mauricio Faria de Oliveira Date: Tue, 25 Oct 2016 20:13:08 -0200 Subject: libaio: harness: fix build errors due to attribute warn_unused_result This patch fixes the following build errors: cases/18.t:94:2: error: ignoring return value of 'write', declared with attribute warn_unused_resultg [-Werror=unused-result] write(fd, buffer, PAGE_SIZE); cases/8.t:17:4: error: ignoring return value of 'ftruncate', declared with attribute warn_unused_result [-Werror=unused-result] ftruncate(fd, 0); Signed-off-by: Mauricio Faria de Oliveira Signed-off-by: Jeff Moyer --- harness/cases/18.t | 3 ++- harness/cases/8.t | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'harness') diff --git a/harness/cases/18.t b/harness/cases/18.t index 6bb0377..5587ceb 100644 --- a/harness/cases/18.t +++ b/harness/cases/18.t @@ -91,7 +91,8 @@ test_main(void) assert(fd != -1); memset(buffer, FILEPATTERN, PAGE_SIZE); - write(fd, buffer, PAGE_SIZE); + ret = write(fd, buffer, PAGE_SIZE); + assert(ret == PAGE_SIZE); close(fd); for (i = 0; i < THREADS_NUM; i++) { diff --git a/harness/cases/8.t b/harness/cases/8.t index e59199f..dbcf044 100644 --- a/harness/cases/8.t +++ b/harness/cases/8.t @@ -9,12 +9,14 @@ long long get_fs_limit(int fd) { long long min = 0, max = 9223372036854775807LL; char c = 0; + int ret; while (max - min > 1) { if (pwrite64(fd, &c, 1, (min + max) / 2) == -1) max = (min + max) / 2; else { - ftruncate(fd, 0); + ret = ftruncate(fd, 0); + assert(ret == 0); min = (min + max) / 2; } } -- cgit v1.2.1