Skip to content

Commit b4d9b3c

Browse files
author
Joshua Peterson
authored
Merge pull request #1307 from Unity-Technologies/fix-exfat-file-sharing
Correct file sharing for exFAT partitions on macOS (case 1253812)
2 parents a751963 + 7ca9aae commit b4d9b3c

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

mono/metadata/w32file-unix.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1794,14 +1794,15 @@ static mode_t convert_perms(guint32 sharemode)
17941794
static gboolean already_shared(gboolean file_alread_shared, ino_t inode)
17951795
{
17961796
#if HOST_DARWIN
1797-
/* On macOS and FAT32 partitions, we will sometimes get this inode value
1798-
* for more than one file. It means the file is empty (FILENO_EMPTY is
1799-
* defined in an internal header). When this happens, the hash table of
1800-
* file shares becomes corrupt, since more then one file has the same
1801-
* inode. Instead, let's assume it is always fine to share empty files.
1802-
* (Unity case 950616).
1797+
/* On macOS and FAT32 partitions, we will sometimes get an inode value
1798+
* of 999999999 (or 1 on exFAT partitions) for more than one file. It
1799+
* means the file is empty (FILENO_EMPTY is defined in an internal
1800+
* header). When this happens, the hash table of file shares becomes
1801+
* corrupt, since more then one file has the same inode. Instead, let's
1802+
* assume it is always fine to share empty files.
1803+
* (Unity case 950616 or case 1253812).
18031804
*/
1804-
return file_alread_shared && inode != 999999999;
1805+
return file_alread_shared && inode != 999999999 && inode != 1;
18051806
#else
18061807
return file_alread_shared;
18071808
#endif

0 commit comments

Comments
 (0)