提交 056a0286 编写于 作者: Y Yumikiyo Osanai

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: NYumikiyo Osanai <yumios.art@gmail.com>
上级 eec86952
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册