2
0
mirror of https://codeberg.org/kiss-community/repo synced 2024-11-15 11:10:08 -07:00
repo/extra/rust/patches/lfs64-getrandom.patch

26 lines
878 B
Diff
Raw Normal View History

2023-07-19 19:08:30 -06:00
diff --git a/vendor/getrandom-0.2.8/src/util_libc.rs b/vendor/getrandom-0.2.8/src/util_libc.rs
index d057071..83a3f2b 100644
--- a/vendor/getrandom-0.2.8/src/util_libc.rs
+++ b/vendor/getrandom-0.2.8/src/util_libc.rs
@@ -135,19 +135,11 @@ impl Weak {
}
}
-cfg_if! {
- if #[cfg(any(target_os = "linux", target_os = "emscripten"))] {
- use libc::open64 as open;
- } else {
- use libc::open;
- }
-}
-
// SAFETY: path must be null terminated, FD must be manually closed.
pub unsafe fn open_readonly(path: &str) -> Result<libc::c_int, Error> {
debug_assert_eq!(path.as_bytes().last(), Some(&0));
loop {
- let fd = open(path.as_ptr() as *const _, libc::O_RDONLY | libc::O_CLOEXEC);
+ let fd = libc::open(path.as_ptr() as *const _, libc::O_RDONLY | libc::O_CLOEXEC);
if fd >= 0 {
return Ok(fd);
}