Fix: FileStream.Dispose silently fails on Dispose when disk has run out of space...
authorCarlos Sanchez <1175054+carlossanlop@users.noreply.github.com>
Tue, 11 Aug 2020 16:39:56 +0000 (09:39 -0700)
committerGitHub <noreply@github.com>
Tue, 11 Aug 2020 16:39:56 +0000 (09:39 -0700)
commit09048ded3891d3ebf0a396049286d2fa4cee0eff
tree9f09d89898889450680ea64ab483e5b0ad465823
parent65e51b7d7c3bd1c4f420931480bf4b09b6fb578d
Fix: FileStream.Dispose silently fails on Dispose when disk has run out of space (#38742)

* Save last error info in SafeFileHandle.ReleaseHandle and read it in FileStream.Dispose

* Add manual test

* Remove Debug.Fail from SafeFileHandle, automate the drive filling step in the manual test, add suggested comments, make threadstatic field static.

* Address suggestions

* Update src/libraries/System.IO.FileSystem/tests/ManualTests/ManualTests.cs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
src/libraries/System.IO.FileSystem/System.IO.FileSystem.sln
src/libraries/System.IO.FileSystem/tests/ManualTests/ManualTests.cs [new file with mode: 0644]
src/libraries/System.IO.FileSystem/tests/ManualTests/System.IO.FileSystem.Manual.Tests.csproj [new file with mode: 0644]
src/libraries/System.Private.CoreLib/src/Microsoft/Win32/SafeHandles/SafeFileHandle.Unix.cs
src/libraries/System.Private.CoreLib/src/System/IO/FileStream.Unix.cs