Remove Platform.HasSingleRootFilesystem query

This commit is contained in:
Andrew Schwartzmeyer
2016-07-14 17:34:12 -07:00
parent e6c037c666
commit 527f30a013
3 changed files with 10 additions and 11 deletions
@@ -217,18 +217,12 @@ namespace System.Management.Automation
}
// Linux has a single rooted file system
internal static bool HasSingleRootFilesystem()
{
return !IsWindows;
}
// Linux has no notion of file shares. It has mount points
// instead, which are subdirectories of its single-root
// filesystem.
internal static bool HasFileShares()
{
return !HasSingleRootFilesystem();
return IsWindows();
}
// Linux has no support for UNC, just mounts in a single rooted hierarchy
@@ -947,12 +947,14 @@ namespace Microsoft.PowerShell.Commands
root = newDrive.RootDirectory.FullName;
}
#if LINUX
// Porting notes: On platforms with single root filesystems, only
// add the filesystem with the root "/" to the initial drive list,
// otherwise path handling will not work correctly because there
// is no : available to separate the filesystems from each other
if (Platform.HasSingleRootFilesystem() && root != StringLiterals.DefaultPathSeparatorString)
if (root != StringLiterals.DefaultPathSeparatorString)
continue;
#endif
// Porting notes: On non-windows platforms .net can report two
// drives with the same root, make sure to only add one of those
@@ -1589,9 +1589,12 @@ namespace System.Management.Automation
/// </returns>
internal static bool IsSingleFileSystemAbsolutePath(string path)
{
return Platform.HasSingleRootFilesystem() &&
(path.StartsWith(StringLiterals.DefaultPathSeparatorString, StringComparison.Ordinal) ||
path.StartsWith(StringLiterals.AlternatePathSeparatorString, StringComparison.Ordinal));
#if LINUX
return path.StartsWith(StringLiterals.DefaultPathSeparatorString, StringComparison.Ordinal)
|| path.StartsWith(StringLiterals.AlternatePathSeparatorString, StringComparison.Ordinal);
#else
return false;
#endif
} // IsSingleFileSystemAbsolutePath
/// <summary>