From 056a0286d279239c279d1e430e7a4b8619f4a337 Mon Sep 17 00:00:00 2001 From: Yumikiyo Osanai Date: Sat, 8 Mar 2014 02:14:34 +0900 Subject: [PATCH] Modify the compile error about ftruncate() Summary: Change to store the return value from ftruncate(). The reason is that ftruncate() has "warn_unused_result" attribute in some environment. Signed-off-by: Yumikiyo Osanai --- util/env_posix.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/env_posix.cc b/util/env_posix.cc index ef7655e60..e019d6af0 100644 --- a/util/env_posix.cc +++ b/util/env_posix.cc @@ -688,7 +688,8 @@ class PosixWritableFile : public WritableFile { GetPreallocationStatus(&block_size, &last_allocated_block); if (last_allocated_block > 0) { // trim the extra space preallocated at the end of the file - ftruncate(fd_, filesize_); // ignore errors + int dummy __attribute__((unused)); + dummy = ftruncate(fd_, filesize_); // ignore errors } if (close(fd_) < 0) {