about summary refs log tree commit diff
path: root/library/std
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-08-29 00:37:48 +0000
committerbors <bors@rust-lang.org>2023-08-29 00:37:48 +0000
commitfef2f5907f4d59586e47be182d42c7a934dc3156 (patch)
tree8050e89b384ea3577323c8f736889f18fb8d1552 /library/std
parent191dc54dbf234210ea4b2cb22b69483f26a33b40 (diff)
parent5853c2bdd36456dfddab0470a9338415a4fb3ed5 (diff)
downloadrust-fef2f5907f4d59586e47be182d42c7a934dc3156.tar.gz
rust-fef2f5907f4d59586e47be182d42c7a934dc3156.zip
Auto merge of #115309 - hermitcore:hermit-net-init, r=cuviper
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`]: https://github.com/hermitcore/hermit-rs/commit/e38f246e046c3ad50bd2f5e33d8d810d33891cbd#diff-a9b7fa816defab285f0d4fe69d4df4a0cbbcf1c89913000df3273aded949f257R10
Diffstat (limited to 'library/std')
-rw-r--r--library/std/src/sys/hermit/mod.rs1
-rw-r--r--library/std/src/sys/hermit/net.rs8
2 files changed, 1 insertions, 8 deletions
diff --git a/library/std/src/sys/hermit/mod.rs b/library/std/src/sys/hermit/mod.rs
index c7cb8466705..fb22d3e22cd 100644
--- a/library/std/src/sys/hermit/mod.rs
+++ b/library/std/src/sys/hermit/mod.rs
@@ -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);
 }
 
diff --git a/library/std/src/sys/hermit/net.rs b/library/std/src/sys/hermit/net.rs
index 8c2d489d6a3..bffda7a8139 100644
--- a/library/std/src/sys/hermit/net.rs
+++ b/library/std/src/sys/hermit/net.rs
@@ -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);