mirror of
https://git.ryujinx.app/kenji-nx/ryujinx.git
synced 2025-12-20 16:37:07 +00:00
misc: chore: Merge duplicated 'if' branches
This commit is contained in:
parent
dfb6164ba5
commit
d773bd60f4
22 changed files with 76 additions and 306 deletions
|
|
@ -94,12 +94,8 @@ namespace Ryujinx.Memory
|
|||
throw new SystemException(Marshal.GetLastPInvokeErrorMessage());
|
||||
}
|
||||
|
||||
if (madvise(address, size, MADV_REMOVE) != 0)
|
||||
{
|
||||
throw new SystemException(Marshal.GetLastPInvokeErrorMessage());
|
||||
}
|
||||
|
||||
if (mprotect(address, size, MmapProts.PROT_NONE) != 0)
|
||||
if (madvise(address, size, MADV_REMOVE) != 0
|
||||
|| mprotect(address, size, MmapProts.PROT_NONE) != 0)
|
||||
{
|
||||
throw new SystemException(Marshal.GetLastPInvokeErrorMessage());
|
||||
}
|
||||
|
|
@ -186,12 +182,7 @@ namespace Ryujinx.Memory
|
|||
fixed (byte* pFileName = fileName)
|
||||
{
|
||||
fd = mkstemp((IntPtr)pFileName);
|
||||
if (fd == -1)
|
||||
{
|
||||
throw new SystemException(Marshal.GetLastPInvokeErrorMessage());
|
||||
}
|
||||
|
||||
if (unlink((IntPtr)pFileName) != 0)
|
||||
if (fd == -1 || unlink((IntPtr)pFileName) != 0)
|
||||
{
|
||||
throw new SystemException(Marshal.GetLastPInvokeErrorMessage());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue