mirror of
https://github.com/Prowlarr/Prowlarr
synced 2026-05-08 04:30:26 +02:00
Fallback to host sqlite3 on FreeBSD and Linux
This commit is contained in:
parent
f568906876
commit
ef5d670c39
1 changed files with 17 additions and 1 deletions
|
|
@ -63,7 +63,23 @@ public static void RegisterSQLiteResolver()
|
|||
|
||||
private static IntPtr LoadSqliteNativeLib(string libraryName, Assembly assembly, DllImportSearchPath? dllImportSearchPath)
|
||||
{
|
||||
var mappedName = OsInfo.IsLinux && libraryName == "sqlite3" ? "libsqlite3.so.0" : libraryName;
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(libraryName);
|
||||
|
||||
var mappedName = libraryName;
|
||||
|
||||
if (libraryName is "sqlite3" or "e_sqlite3")
|
||||
{
|
||||
if (OsInfo.IsLinux)
|
||||
{
|
||||
if (NativeLibrary.TryLoad(libraryName, assembly, dllImportSearchPath, out var libHandle))
|
||||
{
|
||||
return libHandle;
|
||||
}
|
||||
|
||||
mappedName = "libsqlite3.so.0";
|
||||
}
|
||||
}
|
||||
|
||||
return NativeLibrary.Load(mappedName, assembly, dllImportSearchPath);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue