File: fix-libc-timespec.patch

package info (click to toggle)
fish 4.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 35,976 kB
  • sloc: python: 6,972; javascript: 1,407; sh: 1,009; xml: 411; ansic: 230; objc: 78; makefile: 20
file content (16 lines) | stat: -rw-r--r-- 684 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Description: libc::timespec has a private __pad field on some platforms.
 Use std::mem::zeroed() to create it, as an initialized timespec struct
 should have been all zero.
Forwarded: not-needed
Last-Update: 2025-11-21
--- a/src/input_common.rs
+++ b/src/input_common.rs
@@ -549,4 +549,4 @@
-    let timeout = libc::timespec {
-        tv_sec: (wait_nsec / NSEC_PER_SEC).try_into().unwrap(),
-        tv_nsec: (wait_nsec % NSEC_PER_SEC).try_into().unwrap(),
-    };
+    let mut timeout: libc::timespec = unsafe { std::mem::zeroed() };
+    timeout.tv_sec = (wait_nsec / NSEC_PER_SEC).try_into().unwrap();
+    timeout.tv_nsec = (wait_nsec % NSEC_PER_SEC).try_into().unwrap();
+    ;