mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Env: Actually use the full ffi.load signature in our overload
We *do* actually use the optional global argument sometime... Namely, for librt in ffi/posix_h. c.f., https://github.com/koreader/koreader-base/pull/1586#issuecomment-1637184501
This commit is contained in:
@@ -15,8 +15,8 @@ if ffi.os == "Windows" then
|
||||
end
|
||||
local ffi_load = ffi.load
|
||||
-- patch ffi.load for thirdparty luajit libraries
|
||||
ffi.load = function(lib)
|
||||
io.write("ffi.load: ", lib, "\n")
|
||||
ffi.load = function(lib, global)
|
||||
io.write("ffi.load: ", lib, global and " (RTLD_GLOBAL)\n" or "\n")
|
||||
local loaded, re = pcall(ffi_load, lib)
|
||||
if loaded then return re end
|
||||
|
||||
@@ -27,6 +27,6 @@ ffi.load = function(lib)
|
||||
error("Not able to load dynamic library: " .. lib)
|
||||
else
|
||||
io.write("ffi.load (assisted searchpath): ", lib_path, "\n")
|
||||
return ffi_load(lib_path)
|
||||
return ffi_load(lib_path, global)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user