Skip to content

Commit

Permalink
Bugfix: When loading a library via dlopen using a name, a SONAME of t…
Browse files Browse the repository at this point in the history
…hat library should be used.
  • Loading branch information
peters committed Sep 15, 2022
1 parent fe72153 commit 73ab9be
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Snap/CoreRunLib.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Runtime.InteropServices;
using Snap.Core;
Expand Down Expand Up @@ -210,13 +210,13 @@ public override bool Equals(object obj)
public static bool operator !=(pid_t v1, pid_t v2) => v1.Value != v2.Value;
}

[DllImport("libdl", SetLastError = true, EntryPoint = "dlsym", CharSet = CharSet.Ansi)]
[DllImport("libdl.so.2", SetLastError = true, EntryPoint = "dlsym", CharSet = CharSet.Ansi)]
public static extern IntPtr dlsym(IntPtr handle, string symbol);
[DllImport("libdl", SetLastError = true, EntryPoint = "dlopen", CharSet = CharSet.Ansi)]
[DllImport("libdl.so.2", SetLastError = true, EntryPoint = "dlopen", CharSet = CharSet.Ansi)]
public static extern IntPtr dlopen(string filename, int flags);
[DllImport("libdl", SetLastError = true, EntryPoint = "dlclose")]
[DllImport("libdl.so.2", SetLastError = true, EntryPoint = "dlclose")]
public static extern int dlclose(IntPtr hModule);
[DllImport("libc", SetLastError = true, EntryPoint = "kill")]
[DllImport("libdl.so.2", SetLastError = true, EntryPoint = "kill")]
public static extern int kill (pid_t pid, int sig);
}

Expand Down

0 comments on commit 73ab9be

Please sign in to comment.