From: Sangwan Kwon Date: Tue, 7 Jan 2020 04:01:07 +0000 (+0900) Subject: Change fallocate() to posix_fallocate() X-Git-Tag: submit/tizen/20200107.053941 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Ftags%2Fsubmit%2Ftizen%2F20200107.053941;p=platform%2Fcore%2Fsecurity%2Fode.git Change fallocate() to posix_fallocate() For the portable, POSIX.1-specified method of ensuring that space is allocated for a file. The main reason of this patch is to support GCC 9.2. ref) https://review.tizen.org/gerrit/gitweb?p=platform%2Fcore%2Fsecurity%2Fode.git;a=shortlog;h=refs%2Fheads%2Fsandbox%2Fakazmin%2Ftizen_6.0_build Change-Id: I8baf4feb5fce364f6ecf0ba08c46b90ac7ca1457 Signed-off-by: Sangwan Kwon --- diff --git a/server/file-sink.cpp b/server/file-sink.cpp index 091b69b..e1fc324 100644 --- a/server/file-sink.cpp +++ b/server/file-sink.cpp @@ -74,7 +74,7 @@ void FileLogSink::resize() if (blkcnt <= MAX_LOG_LEN) return; - ret = ::fallocate(fd, FALLOC_FL_COLLAPSE_RANGE, 0, blksize*(blkcnt-MAX_LOG_LEN)); + ret = ::posix_fallocate(fd, 0, blksize*(blkcnt-MAX_LOG_LEN)); if (ret < 0) std::cerr << "Failed to collapse the log file : " << errno << std::endl; }