From d7fd637ca31b2a35ae5288f4638f0f99fa4250e0 Mon Sep 17 00:00:00 2001 From: 4lDO2 <4lDO2@protonmail.com> Date: Tue, 27 Jun 2023 16:39:25 +0200 Subject: [PATCH] Fix warnings. --- src/exec.rs | 3 +-- src/initfs.rs | 2 +- src/lib.rs | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/exec.rs b/src/exec.rs index 524a12308f..c0587cc85d 100644 --- a/src/exec.rs +++ b/src/exec.rs @@ -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::>() }; @@ -71,7 +70,7 @@ pub fn main() -> ! { } unsafe fn spawn_initfs(initfs_start: usize, initfs_length: usize) { - let read = syscall::open("pipe:", syscall::O_CLOEXEC).expect("failed to open sync read pipe"); + 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"); diff --git a/src/initfs.rs b/src/initfs.rs index 5c6fd84f4c..7303134594 100644 --- a/src/initfs.rs +++ b/src/initfs.rs @@ -281,6 +281,6 @@ pub fn run(bytes: &'static [u8], sync_pipe: usize) -> ! { } } } - syscall::exit(0); + syscall::exit(0).expect("initfs: failed to exit"); unreachable!() } diff --git a/src/lib.rs b/src/lib.rs index b0601dd061..3a000f6847 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,6 @@ #![no_std] #![feature( asm_const, - asm_sym, alloc_error_handler, core_intrinsics, lang_items,