Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit b9f4180

Browse files
author
Jonathan Miller
committed
Addressing PR feedback
1 parent 954aabd commit b9f4180

File tree

9 files changed

+13
-20
lines changed

9 files changed

+13
-20
lines changed

src/Common/src/Interop/FreeBSD/Interop.Libraries.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@ private static partial class Libraries
1111
internal const string INODE64SUFFIX = "";
1212

1313
internal const string LibRt = "librt"; // POSIX Realtime Extensions library
14-
internal const string libc = "libc"; // C runtime
1514
}
1615
}

src/Common/src/Interop/FreeBSD/libc/Interop.statfs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ internal static unsafe String GetMountPointFsType(statfs data)
5151
return Marshal.PtrToStringAnsi((IntPtr)data.f_fstypename);
5252
}
5353
}
54-
}
54+
}

src/Common/src/Interop/Linux/Interop.Libraries.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@ private static partial class Libraries
1111
internal const string INODE64SUFFIX = "";
1212

1313
internal const string LibRt = "librt"; // POSIX Realtime Extensions library
14-
internal const string libc = "libc"; // C runtime
1514
}
1615
}

src/Common/src/Interop/Linux/libc/Interop.statfs.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ internal static partial class libc
1414
/// <remarks>
1515
/// These value names MUST be kept in sync with those in DriveInfo.Unix.GetDriveType
1616
/// </remarks>
17-
internal enum LinuxFileSystemTypes : long
17+
private enum LinuxFileSystemTypes : long
1818
{
1919
adfs = 0xadf5,
2020
affs = 0xADFF,
@@ -91,4 +91,4 @@ internal static unsafe String GetMountPointFsType(statfs data)
9191
return ((LinuxFileSystemTypes)data.f_type).ToString();
9292
}
9393
}
94-
}
94+
}

src/Common/src/Interop/OSX/Interop.Libraries.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ private static partial class Libraries
1616

1717
internal const string CoreFoundationLibrary = "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation";
1818
internal const string CoreServicesLibrary = "/System/Library/Frameworks/CoreServices.framework/CoreServices";
19-
internal const string libc = "libc";
2019
internal const string libproc = "libproc";
2120
internal const string LibSystemKernel = "/usr/lib/system/libsystem_kernel";
2221
}

src/Common/src/Interop/OSX/libc/Interop.statfs.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ internal static partial class Interop
1010
{
1111
internal static partial class libc
1212
{
13-
internal const int MAXPATHLEN = 1024;
14-
internal const int MFSTYPENAMELEN = 16;
13+
private const int MAXPATHLEN = 1024;
14+
private const int MFSTYPENAMELEN = 16;
1515

1616
[StructLayout(LayoutKind.Sequential)]
1717
internal unsafe struct fsid_t
@@ -45,4 +45,4 @@ internal static unsafe String GetMountPointFsType(statfs data)
4545
return Marshal.PtrToStringAnsi((IntPtr)data.f_fstypename);
4646
}
4747
}
48-
}
48+
}

src/Common/src/Interop/Unix/libc/Interop.mountpoints.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ internal static partial class Interop
1010
{
1111
internal static partial class libc
1212
{
13-
[DllImport("libc")]
14-
static extern int printf(string data);
1513
/// <summary>
1614
/// Gets all the current mount points on the system
1715
/// </summary>
@@ -22,7 +20,7 @@ internal static partial class libc
2220
/// Do NOT free this memory...this memory is allocated by the OS, which is responsible for it.
2321
/// This call could also block for a bit to wait for slow network drives.
2422
/// </remarks>
25-
[DllImport(Interop.Libraries.libc, EntryPoint = "getmntinfo" + Interop.Libraries.INODE64SUFFIX, SetLastError = true)]
23+
[DllImport(Interop.Libraries.Libc, EntryPoint = "getmntinfo" + Interop.Libraries.INODE64SUFFIX, SetLastError = true)]
2624
internal static unsafe extern int getmntinfo(statfs** ppBuffer, int flags);
2725

2826
/// <summary>
@@ -31,8 +29,8 @@ internal static partial class libc
3129
/// <param name="path">The path to retrieve the statfs for</param>
3230
/// <param name="buffer">The output statfs struct describing the mount point</param>
3331
/// <returns>Returns 0 on success, -1 on failure</returns>
34-
[DllImport(Interop.Libraries.libc, EntryPoint = "statfs" + Interop.Libraries.INODE64SUFFIX, SetLastError = true)]
35-
private static unsafe extern int get_statfs(string path, statfs* buffer);
32+
[DllImport(Interop.Libraries.Libc, EntryPoint = "statfs" + Interop.Libraries.INODE64SUFFIX, SetLastError = true)]
33+
private static unsafe extern int get_statfs(string path, out statfs buffer);
3634

3735
/// <summary>
3836
/// Gets a statfs struct for a given mount point
@@ -42,7 +40,7 @@ internal static partial class libc
4240
internal static unsafe statfs GetStatFsForDriveName(string name)
4341
{
4442
statfs data = default(statfs);
45-
int result = get_statfs(name, &data);
43+
int result = get_statfs(name, out data);
4644
if (result < 0)
4745
{
4846
int errno = Marshal.GetLastWin32Error();
@@ -53,10 +51,8 @@ internal static unsafe statfs GetStatFsForDriveName(string name)
5351
}
5452
else
5553
{
56-
printf(System.Runtime.InteropServices.Marshal.SizeOf<statfs>().ToString() + "\r\n");
57-
printf("Should be here\r\n");
5854
return data;
5955
}
6056
}
6157
}
62-
}
58+
}

src/System.IO.FileSystem.DriveInfo/src/System/IO/DriveInfo.Unix.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,4 +244,4 @@ private static DriveType GetDriveType(string fileSystemName)
244244
}
245245
}
246246
}
247-
}
247+
}

src/System.IO.FileSystem.DriveInfo/src/System/IO/DriveType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ public enum DriveType
1616
CDRom = 5,
1717
Ram = 6
1818
}
19-
}
19+
}

0 commit comments

Comments
 (0)