diff --git a/Cargo.lock b/Cargo.lock index 67c8a2b9f4..2808039591 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -71,6 +71,12 @@ dependencies = [ "typenum", ] +[[package]] +name = "libc" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" + [[package]] name = "opaque-debug" version = "0.2.3" @@ -106,6 +112,7 @@ dependencies = [ "rand_chacha", "rand_core", "raw-cpuid", + "redox-daemon", "redox_syscall", "sha2", ] @@ -121,6 +128,14 @@ dependencies = [ "rustc_version", ] +[[package]] +name = "redox-daemon" +version = "0.1.0" +dependencies = [ + "libc", + "redox_syscall", +] + [[package]] name = "redox_syscall" version = "0.2.16" diff --git a/Cargo.toml b/Cargo.toml index 2a3c0f3cf3..fcdcbc1aa5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,7 @@ version = "0.1.0" [dependencies] rand_chacha = "0.2" rand_core = "0.5" +redox-daemon = "0.1" redox_syscall = "0.2.12" sha2 = "0.8" diff --git a/src/main.rs b/src/main.rs index deaa9cf42e..cc39f87cb8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -392,7 +392,7 @@ impl SchemeMut for RandScheme { } } -fn daemon(daemon: syscall::Daemon) -> core::convert::Infallible { +fn daemon(daemon: redox_daemon::Daemon) -> ! { let socket = File::create(":rand").expect("randd: failed to create rand scheme"); let mut scheme = RandScheme::new(socket); @@ -426,5 +426,5 @@ fn daemon(daemon: syscall::Daemon) -> core::convert::Infallible { } fn main() { - syscall::Daemon::new(daemon).expect("randd: failed to daemonize"); + redox_daemon::Daemon::new(daemon).expect("randd: failed to daemonize"); }