File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 22// Licensed to The .NET Foundation under one or more agreements.
33// The .NET Foundation licenses this file to you under the MIT license.
44// -----------------------------------------------------------------------
5- #nullable enable
65
76using System ;
87using System . IO ;
@@ -21,8 +20,9 @@ internal class FileHandle : IDisposable
2120 private readonly FileMode mode ;
2221 private readonly FileAccess access ;
2322 private readonly FileShare share ;
23+ #nullable enable
2424 private static readonly MethodInfo ? SetUnixFileMode = TryGetSetUnixFileMode ( ) ;
25-
25+ #nullable disable
2626 private static readonly TimeSpan LockWaitTimeout = TimeSpan . FromMilliseconds ( 5000 ) ;
2727
2828 public FileHandle ( string file , FileMode mode , FileAccess access , FileShare share )
@@ -79,6 +79,7 @@ private static string GetObjectName(string file, string type)
7979 . Replace ( Path . VolumeSeparatorChar , '_' ) ;
8080 }
8181
82+ #nullable enable
8283 private static MethodInfo ? TryGetSetUnixFileMode ( )
8384 {
8485 MethodInfo ? mi = null ;
@@ -91,11 +92,15 @@ private static string GetObjectName(string file, string type)
9192 {
9293 mi = typeof ( File ) . GetMethod ( "SetUnixFileMode" , new Type [ ] { typeof ( SafeFileHandle ) , Type . GetType ( "System.IO.UnixFileMode" ) } ) ;
9394 }
94- catch { }
95+ catch
96+ {
97+ // ignored
98+ }
9599 }
96100
97101 return mi ;
98102 }
103+ #nullable disable
99104
100105 private class FileLock : IDisposable
101106 {
You can’t perform that action at this time.
0 commit comments