Skip to content

Commit 2488e17

Browse files
authored
Merge pull request #7571 from cakebaker/hostid_use_libc
hostid: use `gethostid` from Rust `libc`
2 parents 765a8b5 + 2a0bfb8 commit 2488e17

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/uu/hostid/src/hostid.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,12 @@
66
// spell-checker:ignore (ToDO) gethostid
77

88
use clap::Command;
9-
use libc::c_long;
9+
use libc::{c_long, gethostid};
1010
use uucore::{error::UResult, format_usage, help_about, help_usage};
1111

1212
const USAGE: &str = help_usage!("hostid.md");
1313
const ABOUT: &str = help_about!("hostid.md");
1414

15-
// currently rust libc interface doesn't include gethostid
16-
unsafe extern "C" {
17-
pub fn gethostid() -> c_long;
18-
}
19-
2015
#[uucore::main]
2116
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
2217
uu_app().try_get_matches_from(args)?;

0 commit comments

Comments
 (0)