From 5853c2bdd36456dfddab0470a9338415a4fb3ed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Mon, 28 Aug 2023 11:30:01 +0200 Subject: [PATCH] fix(sys/hermit): remove obsolete network initialization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This function does not exist as of hermit-sys 0.4.1 [1]. Once std does not call this function, we can remove it entirely. [1]: https://github.com/hermitcore/hermit-rs/commit/e38f246e046c3ad50bd2f5e33d8d810d33891cbd#diff-a9b7fa816defab285f0d4fe69d4df4a0cbbcf1c89913000df3273aded949f257R10 Signed-off-by: Martin Kröning --- library/std/src/sys/hermit/mod.rs | 1 - library/std/src/sys/hermit/net.rs | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/library/std/src/sys/hermit/mod.rs b/library/std/src/sys/hermit/mod.rs index c7cb8466705cb..fb22d3e22cdff 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 8c2d489d6a362..bffda7a813973 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);