added freebsd to the linux path for detecting sparse files support
This commit is contained in:
parent
3f5204aff6
commit
b3e29ba8fa
|
@ -981,7 +981,7 @@ namespace libtorrent
|
||||||
return true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__APPLE__) || defined(__linux__)
|
#if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__)
|
||||||
// find the last existing directory of the save path
|
// find the last existing directory of the save path
|
||||||
fs::path query_path = p;
|
fs::path query_path = p;
|
||||||
while (!query_path.empty() && !exists(query_path))
|
while (!query_path.empty() && !exists(query_path))
|
||||||
|
@ -1019,6 +1019,7 @@ namespace libtorrent
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// workaround for bugs in Mac OS X where zero run is not reported
|
||||||
if (!strcmp(fsinfo.f_fstypename, "hfs")
|
if (!strcmp(fsinfo.f_fstypename, "hfs")
|
||||||
|| !strcmp(fsinfo.f_fstypename, "ufs"))
|
|| !strcmp(fsinfo.f_fstypename, "ufs"))
|
||||||
return true;
|
return true;
|
||||||
|
@ -1026,7 +1027,7 @@ namespace libtorrent
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__linux__) || defined(__FreeBSD__)
|
||||||
struct statfs buf;
|
struct statfs buf;
|
||||||
int err = statfs(query_path.native_directory_string().c_str(), &buf);
|
int err = statfs(query_path.native_directory_string().c_str(), &buf);
|
||||||
if (err == 0)
|
if (err == 0)
|
||||||
|
|
Loading…
Reference in New Issue