File: nix-0.29.patch

package info (click to toggle)
rust-pipewire 0.8.0-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 500 kB
  • sloc: makefile: 2
file content (37 lines) | stat: -rw-r--r-- 1,317 bytes parent folder | download | duplicates (2)
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
Index: pipewire/Cargo.toml
===================================================================
--- pipewire.orig/Cargo.toml
+++ pipewire/Cargo.toml
@@ -45,7 +45,7 @@ version = "2"
 version = "0.2"
 
 [dependencies.nix]
-version = "0.27"
+version = "0.29"
 features = [
     "signal",
     "fs",
Index: pipewire/src/channel.rs
===================================================================
--- pipewire.orig/src/channel.rs
+++ pipewire/src/channel.rs
@@ -162,7 +162,7 @@ impl<T> Sender<T> {
         // If no messages are waiting already, signal the receiver to read some.
         // Because the channel mutex is locked, it is alright to do this before pushing the message.
         if channel.queue.is_empty() {
-            match nix::unistd::write(channel.writefd, &[1u8]) {
+            match nix::unistd::write(unsafe { BorrowedFd::borrow_raw(channel.writefd) } , &[1u8]) {
                 Ok(_) => (),
                 Err(_) => return Err(t),
             }
@@ -207,8 +207,8 @@ where
     let fds = nix::unistd::pipe2(nix::fcntl::OFlag::O_CLOEXEC).unwrap();
 
     let channel: Arc<Mutex<Channel<T>>> = Arc::new(Mutex::new(Channel {
-        readfd: fds.0,
-        writefd: fds.1,
+        readfd: fds.0.into_raw_fd(),
+        writefd: fds.1.into_raw_fd(),
         queue: VecDeque::new(),
     }));