fixes for modules
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
15126ee1b2
commit
5c258f41c8
2 changed files with 43 additions and 15 deletions
|
@ -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"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue