| 1 |
Description: workaround glibc posix violation with regards to suseconds_t |
| 2 |
According to posix tv_usec has type suseconds_t, however glibc with time64 |
| 3 |
violates this defining tv_usec as time_t (a 64-bit type) while defining |
| 4 |
suseconds_t as a 32-bit type. |
| 5 |
|
| 6 |
Most C programs don't care about this difference because C allows implicit |
| 7 |
conversion between different sized integers but rust does not.. |
| 8 |
|
| 9 |
This patch works around the issue by letting the compiler infer the type |
| 10 |
to convert to. |
| 11 |
|
| 12 |
--- rust-net2-0.2.37.orig/src/ext.rs |
| 13 |
+++ rust-net2-0.2.37/src/ext.rs |
| 14 |
@@ -899,7 +899,7 @@ fn ms2timeout(dur: Option<u32>) -> timev |
| 15 |
match dur { |
| 16 |
Some(d) => timeval { |
| 17 |
tv_sec: (d / 1000) as time_t, |
| 18 |
- tv_usec: (d % 1000) as suseconds_t, |
| 19 |
+ tv_usec: (d % 1000) as _, |
| 20 |
}, |
| 21 |
None => timeval { tv_sec: 0, tv_usec: 0 }, |
| 22 |
} |