Skip to content

Commit

Permalink
Auto merge of #115309 - hermitcore:hermit-net-init, r=cuviper
Browse files Browse the repository at this point in the history
fix(sys/hermit): remove obsolete network initialization

This function does not exist as of hermit-sys 0.4.1 ([`e38f246`]). Once std does not call this function, we can remove it entirely.

CC: `@stlankes`

[`e38f246`]: hermit-os/hermit-rs@e38f246#diff-a9b7fa816defab285f0d4fe69d4df4a0cbbcf1c89913000df3273aded949f257R10
  • Loading branch information
bors committed Aug 29, 2023
2 parents 191dc54 + 5853c2b commit fef2f59
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
1 change: 0 additions & 1 deletion library/std/src/sys/hermit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ pub extern "C" fn __rust_abort() {
// SAFETY: must be called only once during runtime initialization.
// NOTE: this is not guaranteed to run, for example when Rust code is called externally.
pub unsafe fn init(argc: isize, argv: *const *const u8, _sigpipe: u8) {
let _ = net::init();
args::init(argc, argv);
}

Expand Down
8 changes: 1 addition & 7 deletions library/std/src/sys/hermit/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,7 @@ pub fn cvt_gai(err: i32) -> io::Result<()> {
))
}

/// Checks whether the HermitCore's socket interface has been started already, and
/// if not, starts it.
pub fn init() {
if unsafe { netc::network_init() } < 0 {
panic!("Unable to initialize network interface");
}
}
pub fn init() {}

#[derive(Debug)]
pub struct Socket(FileDesc);
Expand Down

0 comments on commit fef2f59

Please sign in to comment.