From: Krzysztof Wicher Date: Mon, 5 Nov 2018 18:48:53 +0000 (-0800) Subject: Improve/fix SerialStream.Dispose (dotnet/corefxdotnet/coreclr#33221) X-Git-Tag: submit/tizen/20210909.063632~11030^2~3512 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=461fdef7bbc5b488b14c3c445b131622846b99cb;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Improve/fix SerialStream.Dispose (dotnet/corefxdotnet/coreclr#33221) * Improve/fix SerialStream.Dispose * Review feedback * remove unused using statement * Use ToFileDescriptor Signed-off-by: dotnet-bot Commit migrated from https://github.com/dotnet/coreclr/commit/0eb2dbbc3cd45b2a118aa44ac05bac9b8ca1eec4 --- diff --git a/src/libraries/System.Private.CoreLib/src/Interop/Unix/System.Native/Interop.Read.cs b/src/libraries/System.Private.CoreLib/src/Interop/Unix/System.Native/Interop.Read.cs index 1be5e78..233feab 100644 --- a/src/libraries/System.Private.CoreLib/src/Interop/Unix/System.Native/Interop.Read.cs +++ b/src/libraries/System.Private.CoreLib/src/Interop/Unix/System.Native/Interop.Read.cs @@ -20,6 +20,6 @@ internal static partial class Interop /// Note - on fail. the position of the stream may change depending on the platform; consult man 2 read for more info /// [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Read", SetLastError = true)] - internal static extern unsafe int Read(SafeFileHandle fd, byte* buffer, int count); + internal static extern unsafe int Read(SafeHandle fd, byte* buffer, int count); } } diff --git a/src/libraries/System.Private.CoreLib/src/Interop/Unix/System.Native/Interop.Write.cs b/src/libraries/System.Private.CoreLib/src/Interop/Unix/System.Native/Interop.Write.cs index 0636615..fb06d463 100644 --- a/src/libraries/System.Private.CoreLib/src/Interop/Unix/System.Native/Interop.Write.cs +++ b/src/libraries/System.Private.CoreLib/src/Interop/Unix/System.Native/Interop.Write.cs @@ -19,7 +19,7 @@ internal static partial class Interop /// Returns the number of bytes written on success; otherwise, returns -1 and sets errno /// [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)] - internal static extern unsafe int Write(SafeFileHandle fd, byte* buffer, int bufferSize); + internal static extern unsafe int Write(SafeHandle fd, byte* buffer, int bufferSize); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)] internal static extern unsafe int Write(int fd, byte* buffer, int bufferSize);