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

Commit

Permalink
linux crash fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriyse committed Nov 2, 2016
1 parent b89dd3c commit 34a0aa5
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/runtime/runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#if (UCS4)
using System.Text;
using Mono.Unix;

using Mono.Unix.Native;
#endif

#if (UCS2 && (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35))
Expand Down Expand Up @@ -217,8 +217,8 @@ public class Runtime
internal static bool IsFinalizing = false;

internal static bool wrap_exceptions;
internal static bool is32bit;

internal static bool is32bit;

#if MONO_LINUX
internal static void MakeLibSymLink(List<string> seachPathes)
{
Expand All @@ -243,8 +243,15 @@ internal static void MakeLibSymLink(List<string> seachPathes)
File.Delete(localLibFile);
}

UnixFileInfo libFileInfo = new UnixFileInfo(foundLibFullPath);
libFileInfo.CreateSymbolicLink(localLibFile);
int result = Syscall.symlink(foundLibFullPath, localLibFile);
if (result == -1)
{
// do nothing
}

// This approach crashes mono. At least it's unsafe to use those methods in AssemblyResolve.
//UnixFileInfo libFileInfo = new UnixFileInfo(foundLibFullPath);
//libFileInfo.CreateSymbolicLink(localLibFile);
}
}
catch (Exception ex)
Expand All @@ -253,9 +260,9 @@ internal static void MakeLibSymLink(List<string> seachPathes)
}
}
#else
internal static void MakeLibSymLink(List<string> seachPathes)
{
throw new NotSupportedException("Sym Link patch only required on linux platform.");
static void MakeLibSymLink(List<string> seachPathes)
{
throw new NotSupportedException("Sym Link patch only required on linux platform.");
}
#endif
/// <summary>
Expand Down

0 comments on commit 34a0aa5

Please sign in to comment.