fix(base): drop my P0-daemon-schemedaemon-option-unwrap.patch (was wrong state)
The previous commit (d86bcb24a) added this patch which assumed a
different state of daemon/src/lib.rs than what P0-daemon-fix-init-notify-unwrap.patch
produces. The original P0-daemon-fix-init-notify-unwrap.patch ALREADY
fixes the same lines using a proper closure:
unsafe { get_fd("INIT_NOTIFY").map(|fd| io::PipeWriter::from_raw_fd(fd)) }
vs my (broken) version:
unsafe { get_fd("INIT_NOTIFY").map(io::PipeWriter::from_raw_fd) }
The original uses a closure which makes the unsafe call syntactically
valid. My version passes the function directly which Rust 2024 rejects
because from_raw_fd is unsafe fn.
Removing the redundant patch and relying on P0-daemon-fix-init-notify-unwrap
which is already in the recipe.
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
diff --git a/daemon/src/lib.rs b/daemon/src/lib.rs
|
||||
index 9f507221..38752abc 100644
|
||||
--- a/daemon/src/lib.rs
|
||||
+++ b/daemon/src/lib.rs
|
||||
@@ -83,21 +83,25 @@ impl Daemon {
|
||||
/// A long running background process that handles requests using schemes.
|
||||
#[must_use = "SchemeDaemon::ready must be called"]
|
||||
pub struct SchemeDaemon {
|
||||
- write_pipe: PipeWriter,
|
||||
+ write_pipe: Option<PipeWriter>,
|
||||
}
|
||||
|
||||
impl SchemeDaemon {
|
||||
/// Create a new daemon for use with schemes.
|
||||
pub fn new(f: impl FnOnce(SchemeDaemon) -> !) -> ! {
|
||||
- let write_pipe = unsafe { io::PipeWriter::from_raw_fd(get_fd("INIT_NOTIFY")) };
|
||||
+ let write_pipe = unsafe { get_fd("INIT_NOTIFY").map(io::PipeWriter::from_raw_fd) };
|
||||
|
||||
f(SchemeDaemon { write_pipe })
|
||||
}
|
||||
|
||||
/// Notify the process that the scheme daemon is ready to accept requests.
|
||||
pub fn ready_with_fd(self, cap_fd: Fd) -> syscall::Result<()> {
|
||||
+ let write_pipe = match self.write_pipe {
|
||||
+ Some(pipe) => pipe,
|
||||
+ None => return Ok(()),
|
||||
+ };
|
||||
syscall::call_wo(
|
||||
- self.write_pipe.as_raw_fd() as usize,
|
||||
+ write_pipe.as_raw_fd() as usize,
|
||||
&cap_fd.into_raw().to_ne_bytes(),
|
||||
syscall::CallFlags::FD,
|
||||
&[],
|
||||
@@ -2,7 +2,6 @@
|
||||
git = "https://gitlab.redox-os.org/redox-os/base.git"
|
||||
rev = "463f76b9608a896e6f6c9f63457f57f6409873c7"
|
||||
patches = [
|
||||
"P0-daemon-schemedaemon-option-unwrap.patch",
|
||||
"P0-redox-scheme-bump-0.11.1.patch",
|
||||
"P0-add-missing-driver-members.patch",
|
||||
"P0-init-continuous-scheduling.patch",
|
||||
|
||||
Reference in New Issue
Block a user