Skip to content

Commit 7803a96

Browse files
am11jkotas
andauthored
Use IsOSPlatform instead of checking for /proc (dotnet#101547)
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
1 parent 9d02188 commit 7803a96

File tree

1 file changed

+4
-7
lines changed
  • src/tools/illink/test/Mono.Linker.Tests/Extensions

1 file changed

+4
-7
lines changed

src/tools/illink/test/Mono.Linker.Tests/Extensions/NiceIO.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) .NET Foundation and contributors. All rights reserved.
1+
// Copyright (c) .NET Foundation and contributors. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

44
// The MIT License(MIT)
@@ -31,13 +31,15 @@
3131
using System.Collections.Generic;
3232
using System.IO;
3333
using System.Linq;
34+
using System.Runtime.InteropServices;
3435
using System.Text;
3536

3637
namespace Mono.Linker.Tests.Extensions
3738
{
3839
public class NPath : IEquatable<NPath>, IComparable
3940
{
40-
private static readonly StringComparison PathStringComparison = IsLinux () ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase;
41+
private static readonly StringComparison PathStringComparison = RuntimeInformation.IsOSPlatform (OSPlatform.Windows) ?
42+
StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
4143

4244
private readonly string[] _elements;
4345
private readonly bool _isRelative;
@@ -804,11 +806,6 @@ static bool AlwaysTrue (NPath p)
804806
{
805807
return true;
806808
}
807-
808-
private static bool IsLinux ()
809-
{
810-
return Directory.Exists ("/proc");
811-
}
812809
}
813810

814811
public static class Extensions

0 commit comments

Comments
 (0)