summaryrefslogtreecommitdiff
blob: eb29e580c0587c6900a4dff1e58e315de6740a30 (plain)
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
Fix build with musl 1.2.4

https://bugs.gentoo.org/923901
https://github.com/rust-random/getrandom/pull/326

--- a/src/util_libc.rs
+++ b/src/util_libc.rs
@@ -96,18 +96,10 @@ 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));
-    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 Err(last_os_error());
     }