Skip to content

Commit 5ed22e5

Browse files
cmyrmaan2003
authored andcommitted
Update nix to 0.24.0
1 parent afbe73b commit 5ed22e5

File tree

5 files changed

+9
-18
lines changed

5 files changed

+9
-18
lines changed

druid-shell/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ gdk-sys = { version = "0.14.0", optional = true }
108108
gtk-rs = { version = "0.14.0", features = ["v3_22"], package = "gtk", optional = true }
109109
glib-sys = { version = "0.14.0", optional = true }
110110
gtk-sys = { version = "0.14.0", optional = true }
111-
nix = { version = "0.18.0", optional = true }
111+
nix = { version = "0.24.0", optional = true }
112112
x11rb = { version = "0.8.0", features = ["allow-unsafe-code", "present", "render", "randr", "xfixes", "xkb", "resource_manager", "cursor"], optional = true }
113113
wayland-client = { version = "0.29", optional = true }
114114
wayland-protocols = { version = "0.29", optional = true }

druid-shell/src/backend/wayland/surfaces/buffers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ impl Shm {
369369
self.size = new_size;
370370
return Ok(());
371371
}
372-
Err(e) if matches!(e.as_errno(), Some(Errno::EINTR)) => {
372+
Err(Errno::EINTR) => {
373373
// continue (try again)
374374
}
375375
Err(e) => {

druid-shell/src/backend/x11/application.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -846,10 +846,10 @@ fn drain_idle_pipe(idle_read: RawFd) -> Result<(), Error> {
846846
let mut read_buf = [0u8; 16];
847847
loop {
848848
match nix::unistd::read(idle_read, &mut read_buf[..]) {
849-
Err(nix::Error::Sys(nix::errno::Errno::EINTR)) => {}
849+
Err(nix::errno::Errno::EINTR) => {}
850850
// According to write(2), this is the outcome of reading an empty, O_NONBLOCK
851851
// pipe.
852-
Err(nix::Error::Sys(nix::errno::Errno::EAGAIN)) => {
852+
Err(nix::errno::Errno::EAGAIN) => {
853853
break;
854854
}
855855
Err(e) => {
@@ -944,7 +944,7 @@ fn poll_with_timeout(
944944
}
945945
}
946946

947-
Err(nix::Error::Sys(nix::errno::Errno::EINTR)) => {
947+
Err(nix::errno::Errno::EINTR) => {
948948
now = Instant::now();
949949
}
950950
Err(e) => return Err(e.into()),

druid-shell/src/backend/x11/clipboard.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -689,17 +689,8 @@ fn wait_for_event_with_deadline(
689689
// Wait for the socket to be readable via poll() and try again
690690
match poll(&mut poll_fds, poll_timeout) {
691691
Ok(_) => {}
692-
Err(nix::Error::Sys(nix::errno::Errno::EINTR)) => {}
693-
Err(e) => return Err(nix_error_to_io(e).into()),
692+
Err(nix::errno::Errno::EINTR) => {}
693+
Err(e) => return Err(std::io::Error::from(e).into()),
694694
}
695695
}
696696
}
697-
698-
fn nix_error_to_io(e: nix::Error) -> std::io::Error {
699-
use std::io::{Error, ErrorKind};
700-
match e {
701-
nix::Error::Sys(errno) => errno.into(),
702-
nix::Error::InvalidPath | nix::Error::InvalidUtf8 => Error::new(ErrorKind::InvalidInput, e),
703-
nix::Error::UnsupportedOperation => std::io::Error::new(ErrorKind::Other, e),
704-
}
705-
}

druid-shell/src/backend/x11/window.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,8 +1544,8 @@ impl IdleHandle {
15441544
fn wake(&self) {
15451545
loop {
15461546
match nix::unistd::write(self.pipe, &[0]) {
1547-
Err(nix::Error::Sys(nix::errno::Errno::EINTR)) => {}
1548-
Err(nix::Error::Sys(nix::errno::Errno::EAGAIN)) => {}
1547+
Err(nix::errno::Errno::EINTR) => {}
1548+
Err(nix::errno::Errno::EAGAIN) => {}
15491549
Err(e) => {
15501550
error!("Failed to write to idle pipe: {}", e);
15511551
break;

0 commit comments

Comments
 (0)