Skip to content

Commit

Permalink
[release/7.0] Implement proper File System detection for Apple OSes (#…
Browse files Browse the repository at this point in the history
…74560)

* the assert should fail on macOS

* Don't use statfs on Apple systems, as for them it returns version-specific file system ids.

* move mapping to a separate method and reuse it

* minor improvement

Co-authored-by: Adam Sitnik <[email protected]>
Co-authored-by: Adam Sitnik <[email protected]>
  • Loading branch information
3 people authored Aug 28, 2022
1 parent 211930d commit fe99c44
Show file tree
Hide file tree
Showing 2 changed files with 142 additions and 130 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ internal static bool TryGetFileSystemType(SafeFileHandle fd, out UnixFileSystemT
{
uint fstatfsResult = GetFileSystemType(fd);
fileSystemType = (UnixFileSystemTypes)fstatfsResult;
Debug.Assert(Enum.IsDefined(fileSystemType) || fstatfsResult == 0 || !OperatingSystem.IsLinux(), $"GetFileSystemType returned {fstatfsResult}");
Debug.Assert(Enum.IsDefined(fileSystemType) || fstatfsResult == 0, $"GetFileSystemType returned {fstatfsResult}");
return fstatfsResult != 0;
}
}
Expand Down
Loading

0 comments on commit fe99c44

Please sign in to comment.