From 16617ceadef0914ab14fc124354315afe63915fa Mon Sep 17 00:00:00 2001 From: Marc Bodmer Date: Thu, 20 Oct 2022 16:03:47 +0200 Subject: [PATCH] update nix crate to v0.25 --- Cargo.toml | 4 ++-- src/host/alsa/mod.rs | 17 +++++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d31a806..6590da2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,7 @@ once_cell = "1.12" [target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd"))'.dependencies] alsa = "0.6" -nix = "0.23" +nix = "0.25" libc = "0.2.65" parking_lot = "0.12" jack = { version = "0.9", optional = true } @@ -51,7 +51,7 @@ coreaudio-rs = { version = "0.10", default-features = false, features = ["audio_ coreaudio-rs = { version = "0.10", default-features = false, features = ["audio_unit", "core_audio", "audio_toolbox"] } [target.'cfg(target_os = "emscripten")'.dependencies] -stdweb = { version = "0.1.3", default-features = false } +stdweb = { version = "0.4.20", default-features = false } [target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies] wasm-bindgen = { version = "0.2.58", optional = true } diff --git a/src/host/alsa/mod.rs b/src/host/alsa/mod.rs index b806285..830ef86 100644 --- a/src/host/alsa/mod.rs +++ b/src/host/alsa/mod.rs @@ -255,8 +255,12 @@ impl Device { .map_err(|e| (e, e.errno())); let handle = match handle_result { - Err((_, nix::errno::Errno::EBUSY)) => return Err(BuildStreamError::DeviceNotAvailable), - Err((_, nix::errno::Errno::EINVAL)) => return Err(BuildStreamError::InvalidArgument), + Err((_, alsa::nix::errno::Errno::EBUSY)) => { + return Err(BuildStreamError::DeviceNotAvailable) + } + Err((_, alsa::nix::errno::Errno::EINVAL)) => { + return Err(BuildStreamError::InvalidArgument) + } Err((e, _)) => return Err(e.into()), Ok(handle) => handle, }; @@ -312,10 +316,11 @@ impl Device { .map_err(|e| (e, e.errno())); let handle = match handle_result { - Err((_, nix::errno::Errno::ENOENT)) | Err((_, nix::errno::Errno::EBUSY)) => { + Err((_, alsa::nix::errno::Errno::ENOENT)) + | Err((_, alsa::nix::errno::Errno::EBUSY)) => { return Err(SupportedStreamConfigsError::DeviceNotAvailable) } - Err((_, nix::errno::Errno::EINVAL)) => { + Err((_, alsa::nix::errno::Errno::EINVAL)) => { return Err(SupportedStreamConfigsError::InvalidArgument) } Err((e, _)) => return Err(e.into()), @@ -749,7 +754,7 @@ fn poll_descriptors_and_prepare_buffer( let status = stream.channel.status()?; let avail_frames = match stream.channel.avail() { - Err(err) if err.errno() == nix::errno::Errno::EPIPE => { + Err(err) if err.errno() == alsa::nix::errno::Errno::EPIPE => { return Ok(PollDescriptorsFlow::XRun) } res => res, @@ -832,7 +837,7 @@ fn process_output( } loop { match stream.channel.io_bytes().writei(buffer) { - Err(err) if err.errno() == nix::errno::Errno::EPIPE => { + Err(err) if err.errno() == alsa::nix::errno::Errno::EPIPE => { // buffer underrun // TODO: Notify the user of this. let _ = stream.channel.try_recover(err, false);