mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Refactor and code cleanup.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
2016-07-28 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* DetectOS.cs: Refactor and code cleanup.
|
||||
|
||||
2015-10-19 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* DiscImageChef.Interop.csproj:
|
||||
|
||||
@@ -82,18 +82,18 @@ namespace DiscImageChef.Interop
|
||||
[DllImport("libc", SetLastError = true, EntryPoint = "sysctlbyname", CharSet = CharSet.Ansi)]
|
||||
static extern int OSX_sysctlbyname(string name, IntPtr oldp, IntPtr oldlenp, IntPtr newp, uint newlen);
|
||||
|
||||
public static Interop.PlatformID GetRealPlatformID()
|
||||
public static PlatformID GetRealPlatformID()
|
||||
{
|
||||
if((int)Environment.OSVersion.Platform < 4 ||
|
||||
(int)Environment.OSVersion.Platform == 5)
|
||||
{
|
||||
return (Interop.PlatformID)((int)Environment.OSVersion.Platform);
|
||||
return (PlatformID)((int)Environment.OSVersion.Platform);
|
||||
}
|
||||
|
||||
utsname unixname;
|
||||
int error = uname(out unixname);
|
||||
if(error != 0)
|
||||
throw new Exception(String.Format("Unhandled exception calling uname: {0}", Marshal.GetLastWin32Error()));
|
||||
throw new Exception(string.Format("Unhandled exception calling uname: {0}", Marshal.GetLastWin32Error()));
|
||||
|
||||
switch(unixname.sysname)
|
||||
{
|
||||
@@ -116,7 +116,7 @@ namespace DiscImageChef.Interop
|
||||
{
|
||||
Marshal.FreeHGlobal(pLen);
|
||||
|
||||
throw new Exception(String.Format("Unhandled exception calling uname: {0}", Marshal.GetLastWin32Error()));
|
||||
throw new Exception(string.Format("Unhandled exception calling uname: {0}", Marshal.GetLastWin32Error()));
|
||||
}
|
||||
|
||||
int length = Marshal.ReadInt32(pLen);
|
||||
@@ -127,7 +127,7 @@ namespace DiscImageChef.Interop
|
||||
Marshal.FreeHGlobal(pStr);
|
||||
Marshal.FreeHGlobal(pLen);
|
||||
|
||||
throw new Exception(String.Format("Unhandled exception calling uname: {0}", Marshal.GetLastWin32Error()));
|
||||
throw new Exception(string.Format("Unhandled exception calling uname: {0}", Marshal.GetLastWin32Error()));
|
||||
}
|
||||
|
||||
string machine = Marshal.PtrToStringAnsi(pStr);
|
||||
|
||||
Reference in New Issue
Block a user