Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
baszalmstra committed Jul 14, 2024
1 parent ef46dc1 commit 783bb35
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 9 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,15 @@ pub fn glibc_version() -> Option<(u32, u32)> {

/// Detect the current version of `musl` `libc` by inspecting the `/lib/ld-musl-*.so.1` loaders.
pub fn musl_libc_version() -> Option<(u32, u32)> {
for arch in ["x86_64", "aarch64", "i386", "armhf", "arm", "powerpc64le", "s390x"] {
for arch in [
"x86_64",
"aarch64",
"i386",
"armhf",
"arm",
"powerpc64le",
"s390x",
] {
let loader = PathBuf::from(format!("/lib/ld-musl-{arch}.so.1"));
if !loader.exists() {
continue;
Expand Down
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
fn main() {
println!("{:?}", libc_detector::libc_version());
}
fn main() {
println!("{:?}", libc_detector::libc_version());
}

0 comments on commit 783bb35

Please sign in to comment.