fixes for modules

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk authored and Jason Volk committed 2024-07-28 05:59:12 -07:00
1 parent 15126ee1b2
commit 5c258f41c8
2 files changed
+43 -15

No files matched your search

+2 -2
View File
@@ -1,7 +1,7 @@
use std::ffi::OsStr;
use super::{path, Library};
use crate::{Error, Result};
use crate::{Err, Result};
const OPEN_FLAGS: i32 = libloading::os::unix::RTLD_LAZY | libloading::os::unix::RTLD_GLOBAL;
@@ -16,7 +16,7 @@ pub fn from_path(path: &OsStr) -> Result<Library> {
let lib = unsafe { Library::open(Some(path), OPEN_FLAGS) };
if let Err(e) = lib {
let name = path::to_name(path)?;
return Err(Error::Err(format!("Loading module {name:?} failed: {e}")));
return Err!("Loading module {name:?} failed: {e}");
}
Ok(lib.expect("module loaded"))