From f06af86ac61b9e24f652e5787507b78e6095bfcc Mon Sep 17 00:00:00 2001 From: Noa <33094578+coolreader18@users.noreply.github.com> Date: Fri, 13 Aug 2021 17:27:10 -0500 Subject: [PATCH 1/2] Implement hstrerror --- src/header/netdb/mod.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/header/netdb/mod.rs b/src/header/netdb/mod.rs index 8a510171..20816291 100644 --- a/src/header/netdb/mod.rs +++ b/src/header/netdb/mod.rs @@ -893,3 +893,15 @@ pub extern "C" fn gai_strerror(errcode: c_int) -> *const c_char { } .as_ptr() } + +#[no_mangle] +pub extern "C" fn hstrerror(errcode: c_int) -> *const c_char { + match errcode { + HOST_NOT_FOUND => c_str!("Unknown hostname"), + NO_DATA => c_str!("No address for hostname"), + NO_RECOVERY => c_str!("Unknown server error"), + TRY_AGAIN => c_str!("Hostname lookup failure"), + _ => c_str!("Unknown error"), + } + .as_ptr() +} -- GitLab From 3373d5e2466adfcb961b6377ac0a5e59b99ac6f0 Mon Sep 17 00:00:00 2001 From: Noa <33094578+coolreader18@users.noreply.github.com> Date: Sat, 14 Aug 2021 22:52:49 -0500 Subject: [PATCH 2/2] Install rust-src --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6b697aa5..7fb23fe6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,6 +19,7 @@ build:linux: stage: build script: - rustup toolchain add "$(cat rust-toolchain)" + - rustup component add rust-src - rustup show # Print version info for debugging - make -j "$(nproc)" all -- GitLab