Skip to content

Commit

Permalink
Fix NetBSD support.
Browse files Browse the repository at this point in the history
uname(1) on NetBSD doesn't support '-o', use '-s' instead.

Add missing argument in a test while here.
  • Loading branch information
0-wiz-0 committed Dec 31, 2024
1 parent 7d1b62f commit 708a474
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion os_info/src/netbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::{architecture, bitness, uname::uname, Info, Type, Version};
pub fn current_platform() -> Info {
trace!("netbsd::current_platform is called");

let version = uname("-o")
let version = uname("-s")
.map(Version::from_string)
.unwrap_or_else(|| Version::Unknown);

Expand Down
2 changes: 1 addition & 1 deletion os_info/src/uname.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ mod tests {

#[test]
fn uname_nonempty() {
let val = uname().expect("uname failed");
let val = uname("-s").expect("uname failed");
assert!(!val.is_empty());
}
}

0 comments on commit 708a474

Please sign in to comment.