Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
Add NotNullWhen for TryOpen
Browse files Browse the repository at this point in the history
  • Loading branch information
maryamariyan committed Sep 18, 2019
1 parent 3bb97b1 commit 6bb636e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/System.Console/src/System/TermInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Text;
using Microsoft.Win32.SafeHandles;
Expand Down Expand Up @@ -219,7 +220,7 @@ private Database(string term, byte[] data)
/// <param name="filePath">The path to the file to open.</param>
/// <param name="fd">If successful, the opened file descriptor; otherwise, -1.</param>
/// <returns>true if the file was successfully opened; otherwise, false.</returns>
private static bool TryOpen(string filePath, out SafeFileHandle? fd)
private static bool TryOpen(string filePath, [NotNullWhen(true)] out SafeFileHandle? fd)
{
fd = Interop.Sys.Open(filePath, Interop.Sys.OpenFlags.O_RDONLY | Interop.Sys.OpenFlags.O_CLOEXEC, 0);
if (fd.IsInvalid)
Expand Down

0 comments on commit 6bb636e

Please sign in to comment.