Merge branch 'pipe_scheme' into 'master'

Replace pipe2 with pipe scheme and fix warnings

See merge request redox-os/bootstrap!2
This commit is contained in:
Jeremy Soller
2023-06-30 12:20:35 +00:00
3 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -41,7 +41,6 @@ pub fn main() -> ! {
initfs_length = initfs_length_opt.expect("missing INITFS_LENGTH");
let iter = || raw_iter().filter(|var| !var.starts_with(b"INITFS_"));
let env_count = iter().count();
iter().map(|var| var.to_owned()).collect::<Vec<_>>()
};
@@ -71,9 +70,10 @@ pub fn main() -> ! {
}
unsafe fn spawn_initfs(initfs_start: usize, initfs_length: usize) {
let mut buf = [0; 2];
syscall::pipe2(&mut buf, syscall::O_CLOEXEC).expect("failed to open sync pipe");
let [read, write] = buf;
let read = syscall::open("pipe:", O_CLOEXEC).expect("failed to open sync read pipe");
// The write pipe will not inherit O_CLOEXEC, but is closed by the daemon later.
let write = syscall::dup(read, b"write").expect("failed to open sync write pipe");
match redox_exec::fork_impl() {
Err(err) => {
+2 -1
View File
@@ -258,6 +258,7 @@ pub fn run(bytes: &'static [u8], sync_pipe: usize) -> ! {
.expect("failed to open initfs scheme socket");
let _ = syscall::write(sync_pipe, &[0]);
let _ = syscall::close(sync_pipe);
let mut packet = Packet::default();
@@ -280,6 +281,6 @@ pub fn run(bytes: &'static [u8], sync_pipe: usize) -> ! {
}
}
}
syscall::exit(0);
syscall::exit(0).expect("initfs: failed to exit");
unreachable!()
}
-1
View File
@@ -1,7 +1,6 @@
#![no_std]
#![feature(
asm_const,
asm_sym,
alloc_error_handler,
core_intrinsics,
lang_items,