File: relax-rustix.diff

package info (click to toggle)
rust-wayland-client 0.31.11-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 400 kB
  • sloc: xml: 2,750; makefile: 2
file content (49 lines) | stat: -rw-r--r-- 1,310 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Index: wayland-client/Cargo.toml
===================================================================
--- wayland-client.orig/Cargo.toml
+++ wayland-client/Cargo.toml
@@ -54,7 +54,7 @@ version = "0.4"
 optional = true
 
 [dependencies.rustix]
-version = "1.0.2"
+version = ">= 0.38.37, < 2.0"
 features = ["event"]
 
 [dependencies.wayland-backend]
Index: wayland-client/src/conn.rs
===================================================================
--- wayland-client.orig/src/conn.rs
+++ wayland-client/src/conn.rs
@@ -216,6 +216,22 @@ impl Connection {
     }
 }
 
+trait PollTimeout {
+    fn never() -> Self;
+}
+
+impl PollTimeout for i32 {
+    fn never() -> Self {
+        -1
+    }
+}
+
+impl<T> PollTimeout for Option<T> {
+    fn never() -> Self {
+        None
+    }
+}
+
 pub(crate) fn blocking_read(guard: ReadEventsGuard) -> Result<usize, WaylandError> {
     let fd = guard.connection_fd();
     let mut fds = [rustix::event::PollFd::new(
@@ -224,7 +240,7 @@ pub(crate) fn blocking_read(guard: ReadE
     )];
 
     loop {
-        match rustix::event::poll(&mut fds, None) {
+        match rustix::event::poll(&mut fds, PollTimeout::never()) {
             Ok(_) => break,
             Err(rustix::io::Errno::INTR) => continue,
             Err(e) => return Err(WaylandError::Io(e.into())),