diff --git a/audiod/src/main.rs b/audiod/src/main.rs index f6d16ec828..0ad98c0174 100644 --- a/audiod/src/main.rs +++ b/audiod/src/main.rs @@ -47,10 +47,13 @@ fn daemon(daemon: Daemon) -> anyhow::Result<()> { let pid = libredox::call::getpid()?; - let hw_file = Fd::open("/scheme/audiohw", flag::O_WRONLY | flag::O_CLOEXEC, 0)?; - let socket = Socket::create("audio").context("failed to create scheme")?; + // The scheme is now ready to accept requests, notify the original process + daemon.ready().unwrap(); + + let hw_file = Fd::open("/scheme/audiohw", flag::O_WRONLY | flag::O_CLOEXEC, 0)?; + let scheme = Arc::new(Mutex::new(AudioScheme::new())); // Enter a constrained namespace @@ -67,9 +70,6 @@ fn daemon(daemon: Daemon) -> anyhow::Result<()> { thread(scheme_thread, pid, hw_file) }); - // The scheme is now ready to accept requests, notify the original process - daemon.ready().unwrap(); - let mut readiness = ReadinessBased::new(&socket, 16); loop {