Skip to content

Commit

Permalink
Reapply fix from PixarAnimationStudios#1465 that was reverted by Pixa…
Browse files Browse the repository at this point in the history
…rAnimationStudios#1580 (presumably by accident).

Add a FILE_SHARE_READ flag to the CreateFile call that is used to open a symlink location on Windows. This failure was manifesting as a rare intermittent failure to properly resolve a file path inside a symlinked directory on Windows when running many simultaneous processes reading and writing USD files inside this symlinked directory.
  • Loading branch information
marktucker committed Mar 12, 2022
1 parent 2e443cb commit 70ace61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pxr/base/arch/fileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ typedef struct _REPARSE_DATA_BUFFER {
std::string ArchReadLink(const char* path)
{
HANDLE handle = ::CreateFileW(
ArchWindowsUtf8ToUtf16(path).c_str(), GENERIC_READ, 0,
ArchWindowsUtf8ToUtf16(path).c_str(), GENERIC_READ, FILE_SHARE_READ,
NULL, OPEN_EXISTING,
FILE_FLAG_OPEN_REPARSE_POINT |
FILE_FLAG_BACKUP_SEMANTICS, NULL);
Expand Down

0 comments on commit 70ace61

Please sign in to comment.