Skip to content

Commit

Permalink
Adjust for platform guards
Browse files Browse the repository at this point in the history
  • Loading branch information
JanKrivanek committed Dec 14, 2022
1 parent 95706ab commit 4ab113f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Framework/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1087,11 +1087,15 @@ internal static bool MakeSymbolicLink(string newFileName, string exitingFileName
symbolicLinkCreated = CreateSymbolicLink(newFileName, exitingFileName, flags);
errorMessage = symbolicLinkCreated ? null : Marshal.GetExceptionForHR(Marshal.GetHRForLastWin32Error()).Message;
}
else
else if(IsLinux)
{
symbolicLinkCreated = symlink(exitingFileName, newFileName) == 0;
errorMessage = symbolicLinkCreated ? null : "The link() library call failed with the following error code: " + Marshal.GetLastWin32Error();
}
else
{
symbolicLinkCreated = false;
}

return symbolicLinkCreated;
}
Expand Down

0 comments on commit 4ab113f

Please sign in to comment.