Closed kaazoo closed 9 months ago
I changed the type to u8 and it worked:
$ git diff
diff --git a/src/start.rs b/src/start.rs
index 7dc5f02..aefef28 100644
--- a/src/start.rs
+++ b/src/start.rs
@@ -91,7 +91,7 @@ unsafe fn exec_vm(vmcfg: &VmConfig, rootfs: &str, cmd: Option<&str>, args: Vec<C
let map = format!("{}:{}", host_port, guest_port);
ports.push(CString::new(map).unwrap());
}
- let mut ps: Vec<*const i8> = Vec::new();
+ let mut ps: Vec<*const u8> = Vec::new();
for port in ports.iter() {
ps.push(port.as_ptr());
}
@@ -113,10 +113,10 @@ unsafe fn exec_vm(vmcfg: &VmConfig, rootfs: &str, cmd: Option<&str>, args: Vec<C
let hostname = CString::new(format!("HOSTNAME={}", vmcfg.name)).unwrap();
let home = CString::new("HOME=/root").unwrap();
- let env: [*const i8; 3] = [hostname.as_ptr(), home.as_ptr(), std::ptr::null()];
+ let env: [*const u8; 3] = [hostname.as_ptr(), home.as_ptr(), std::ptr::null()];
if let Some(cmd) = cmd {
- let mut argv: Vec<*const i8> = Vec::new();
+ let mut argv: Vec<*const u8> = Vec::new();
for a in args.iter() {
argv.push(a.as_ptr());
}
I get this error while building with Rust 1.73: