Updated to latest leechcore

pull/7/head
ko1N 4 years ago
parent eca56660a1
commit 058f229d3c

@ -47,7 +47,8 @@ fn build_leechcore(target: &str) {
.map(|o| "src/leechcore/leechcore/".to_string() + o)
.collect::<Vec<_>>(),
)
.flag(&format!("-D{}", os_define()));
.flag(&format!("-D{}", os_define()))
.flag("-D_GNU_SOURCE");
// EXPORTED_FUNCTION= to not export any symbols
if !target.contains("windows") {
@ -105,7 +106,7 @@ fn main() {
// generate bindings
let mut builder = bindgen::builder()
.clang_arg(format!("-D{}", os_define()))
.clang_arg(format!("-D{} -D_GNU_SOURCE", os_define()))
.header("./src/leechcore/leechcore/leechcore.h");
// workaround for windows.h

@ -1 +1 @@
Subproject commit e31a5084e264b4ab3c21238a95f703e994ec3384
Subproject commit 9968fa3d88b3504c0ac68c582f111929afefd103

@ -92,9 +92,8 @@ impl PciLeech {
if handle.is_null() {
// TODO: handle version error
// TODO: handle special case of fUserInputRequest
error!("leechcore error: {:?}", err);
return Err(Error(ErrorOrigin::Connector, ErrorKind::Configuration)
.log_error("unable to create leechcore context"));
.log_error(&format!("unable to create leechcore context: {:?}", err)));
}
Ok(Self {
@ -361,10 +360,13 @@ pub fn create_connector(args: &Args, log_level: Level) -> Result<PciLeech> {
match validator.validate(&args) {
Ok(_) => {
let device = args.get("device").or_else(|| args.get_default()).ok_or(
let device = args
.get("device")
.or_else(|| args.get_default())
.ok_or_else(|| {
Error(ErrorOrigin::Connector, ErrorKind::ArgValidation)
.log_error("'device' argument is missing"),
)?;
.log_error("'device' argument is missing")
})?;
if let Some(memmap) = args.get("memmap") {
PciLeech::with_memmap(device, memmap)

Loading…
Cancel
Save