diff --git a/src/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/FileStreamReadLightUp.netstandard1.1.cs b/src/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/FileStreamReadLightUp.netstandard1.1.cs index 39a3ffdc6ef1..cdd30244fda9 100644 --- a/src/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/FileStreamReadLightUp.netstandard1.1.cs +++ b/src/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/FileStreamReadLightUp.netstandard1.1.cs @@ -100,7 +100,7 @@ internal static unsafe bool TryReadFile(Stream stream, byte* buffer, long start, return false; } - bool result = false; + int result = 0; int bytesRead = 0; try @@ -113,7 +113,7 @@ internal static unsafe bool TryReadFile(Stream stream, byte* buffer, long start, return false; } - if (!result || bytesRead != size) + if (result == 0 || bytesRead != size) { // We used to throw here, but this is where we land if the FileStream was // opened with useAsync: true, which is currently the default on .NET Core.