diff options
author | Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com> | 2016-10-25 20:13:08 -0200 |
---|---|---|
committer | Jeff Moyer <jmoyer@redhat.com> | 2016-10-28 14:24:43 -0400 |
commit | 98127d2b408879ae71349dbb1e0a59cb7c2cce06 (patch) | |
tree | b3258b7bb915ac2c6139a8a0f4c43842146b50a4 | |
parent | 5a546a834c36070648158d19dd564762d59f8eb8 (diff) | |
download | libaio-98127d2b408879ae71349dbb1e0a59cb7c2cce06.tar.gz |
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 <mauricfo@linux.vnet.ibm.com>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
-rw-r--r-- | harness/cases/18.t | 3 | ||||
-rw-r--r-- | harness/cases/8.t | 4 |
2 files changed, 5 insertions, 2 deletions
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; } } |