audiod: daemonize after creating audio scheme
This commit is contained in:
+5
-5
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user