From 5d5ded4032a2e18a56d3c9bcee6e5ced5094a50b Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 18 Jan 2010 01:08:19 +0000 Subject: [PATCH] fix fallocate build with OSes that actually support it --- src/file.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/file.cpp b/src/file.cpp index 795bb23cd..8affef7ef 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -80,7 +80,7 @@ POSSIBILITY OF SUCH DAMAGE. #include // For __NR_fallocate // circumvent the lack of support in glibc -static int fallocate(int fd, int mode, loff_t offset, loff_t len) +static int my_fallocate(int fd, int mode, loff_t offset, loff_t len) { return syscall(__NR_fallocate, fd, mode, offset, len); } @@ -1449,7 +1449,7 @@ namespace libtorrent return false; } #elif defined TORRENT_LINUX - int ret = fallocate(m_fd, FALLOC_FL_KEEP_SIZE, 0, s); + int ret = my_fallocate(m_fd, FALLOC_FL_KEEP_SIZE, 0, s); if (ret != 0 && ret != EOPNOTSUPP && errno != ENOSYS) { ec.assign(ret, get_posix_category());