Skip to content

Commit 88efa3b

Browse files
deeprobintmds
andauthored
Update src/libraries/System.Private.CoreLib/src/System/IO/FileStatus.Unix.cs
Co-authored-by: Tom Deseyn <[email protected]>
1 parent 5b59c8f commit 88efa3b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/libraries/System.Private.CoreLib/src/System/IO/FileStatus.Unix.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,7 @@ internal void RefreshCaches(SafeFileHandle? handle, ReadOnlySpan<char> path)
488488
// Check if the main path is a directory, or a link to a directory.
489489
int fileType = _fileCache.Mode & Interop.Sys.FileTypes.S_IFMT;
490490
bool isDirectory = fileType == Interop.Sys.FileTypes.S_IFDIR ||
491-
(handle is null && // Don't follow links for SafeHandle APIs.
492-
fileType == Interop.Sys.FileTypes.S_IFLNK &&
491+
(fileType == Interop.Sys.FileTypes.S_IFLNK &&
493492
Interop.Sys.Stat(path, out Interop.Sys.FileStatus target) == 0 &&
494493
(target.Mode & Interop.Sys.FileTypes.S_IFMT) == Interop.Sys.FileTypes.S_IFDIR);
495494

0 commit comments

Comments
 (0)