Remerge: Add FAT FS check for FreeBSD

This effectively reapplies commits 21f2dbf1ad and 7ccf26ce4c, except it
has a separate definition for FreeBSD rather than sharing the same one
for FreeBSD and macOS. The code is literally copied and pasted with only
"msdos" being changed to "msdosfs".

Signed-off-by: Avery King <gperson@disroot.org>
This commit is contained in:
Avery King
2025-06-27 09:40:40 -07:00
parent 1ffa9ee516
commit e7a22e8969

View File

@@ -736,6 +736,15 @@ bool FileNames::IsOnFATFileSystem(const FilePath &path)
return false;
return 0 == strcmp(fs.f_fstypename, "msdos");
}
#elif defined(__FreeBSD__)
bool FileNames::IsOnFATFileSystem(const FilePath &path)
{
struct statfs fs;
if (statfs(wxPathOnly(path).c_str(), &fs))
// Error from statfs
return false;
return 0 == strcmp(fs.f_fstypename, "msdosfs");
}
#elif defined(__linux__)
#include <sys/statfs.h>
#include "/usr/include/linux/magic.h"