From b3e29ba8faeff50d94858371360392062f5162bb Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 8 Aug 2007 23:08:55 +0000 Subject: [PATCH] added freebsd to the linux path for detecting sparse files support --- src/storage.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/storage.cpp b/src/storage.cpp index fc18377c0..4dd8cf740 100755 --- a/src/storage.cpp +++ b/src/storage.cpp @@ -981,7 +981,7 @@ namespace libtorrent return true; #endif -#if defined(__APPLE__) || defined(__linux__) +#if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) // find the last existing directory of the save path fs::path query_path = p; while (!query_path.empty() && !exists(query_path)) @@ -1019,6 +1019,7 @@ namespace libtorrent return true; } + // workaround for bugs in Mac OS X where zero run is not reported if (!strcmp(fsinfo.f_fstypename, "hfs") || !strcmp(fsinfo.f_fstypename, "ufs")) return true; @@ -1026,7 +1027,7 @@ namespace libtorrent return false; #endif -#if defined(__linux__) +#if defined(__linux__) || defined(__FreeBSD__) struct statfs buf; int err = statfs(query_path.native_directory_string().c_str(), &buf); if (err == 0)