mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Remove unnecessary indirection from Platform.Unix
This commit is contained in:
1 parent
74c3262f03
commit
70aa6af960
1 file changed
+4
-24
@@ -239,7 +239,7 @@ namespace System.Management.Automation
|
|||||||
|
|
||||||
internal static bool NonWindowsIsSymLink(FileSystemInfo fileInfo)
|
internal static bool NonWindowsIsSymLink(FileSystemInfo fileInfo)
|
||||||
{
|
{
|
||||||
return Unix.IsSymLink(fileInfo);
|
return Unix.NativeMethods.IsSymLink(fileInfo.FullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static string NonWindowsInternalGetTarget(SafeFileHandle handle)
|
internal static string NonWindowsInternalGetTarget(SafeFileHandle handle)
|
||||||
@@ -250,12 +250,12 @@ namespace System.Management.Automation
|
|||||||
|
|
||||||
internal static string NonWindowsInternalGetTarget(string path)
|
internal static string NonWindowsInternalGetTarget(string path)
|
||||||
{
|
{
|
||||||
return Unix.FollowSymLink(path);
|
return Unix.NativeMethods.FollowSymLink(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static string NonWindowsGetUserFromPid(int path)
|
internal static string NonWindowsGetUserFromPid(int path)
|
||||||
{
|
{
|
||||||
return Unix.GetUserFromPid(path);
|
return Unix.NativeMethods.GetUserFromPid(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CORECLR
|
#if CORECLR
|
||||||
@@ -344,7 +344,7 @@ namespace System.Management.Automation
|
|||||||
|
|
||||||
internal static bool NonWindowsIsExecutable(string path)
|
internal static bool NonWindowsIsExecutable(string path)
|
||||||
{
|
{
|
||||||
return Unix.IsExecutable(path);
|
return Unix.NativeMethods.IsExecutable(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static uint NonWindowsGetThreadId()
|
internal static uint NonWindowsGetThreadId()
|
||||||
@@ -516,16 +516,6 @@ namespace System.Management.Automation
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsSymLink(FileSystemInfo fs)
|
|
||||||
{
|
|
||||||
return NativeMethods.IsSymLink(fs.FullName);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool IsExecutable(string filePath)
|
|
||||||
{
|
|
||||||
return NativeMethods.IsExecutable(filePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void SetDate(SetDateInfoInternal info)
|
public static void SetDate(SetDateInfoInternal info)
|
||||||
{
|
{
|
||||||
int ret = NativeMethods.SetDate(info);
|
int ret = NativeMethods.SetDate(info);
|
||||||
@@ -542,16 +532,6 @@ namespace System.Management.Automation
|
|||||||
return ret == 1 ? true : false;
|
return ret == 1 ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string FollowSymLink(string path)
|
|
||||||
{
|
|
||||||
return NativeMethods.FollowSymLink(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetUserFromPid(int pid)
|
|
||||||
{
|
|
||||||
return NativeMethods.GetUserFromPid(pid);
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
internal class SetDateInfoInternal
|
internal class SetDateInfoInternal
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user