From c7956aa41b6a9ec253e990a0b6f5d3d07ff09928 Mon Sep 17 00:00:00 2001 From: Sebastian Sumpf Date: Mon, 6 Nov 2023 17:13:58 +0100 Subject: [PATCH] socket_fs/vfs_lxip: errno 65 is EHOSTUNREACH Return "no route to host" on errno 65 which is EHOSTUNREACH in legacy dde_linux, return EHOSTUNREACH accordingly in libc's socket fs. issue #5031 --- repos/dde_linux/src/lib/vfs/lxip/vfs.cc | 4 ++-- repos/libports/src/lib/libc/socket_fs_plugin.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/repos/dde_linux/src/lib/vfs/lxip/vfs.cc b/repos/dde_linux/src/lib/vfs/lxip/vfs.cc index 8bafdaf6c1..ce1775daa3 100644 --- a/repos/dde_linux/src/lib/vfs/lxip/vfs.cc +++ b/repos/dde_linux/src/lib/vfs/lxip/vfs.cc @@ -791,8 +791,8 @@ class Vfs::Lxip_connect_file final : public Vfs::Lxip_file return Format::snprintf(dst.start, dst.num_bytes, "connected"); case Linux::ECONNREFUSED: return Format::snprintf(dst.start, dst.num_bytes, "connection refused"); - case 65: /* Linux::ENOPKG */ - return Format::snprintf(dst.start, dst.num_bytes, "package not installed"); + case Linux::EHOSTUNREACH: + return Format::snprintf(dst.start, dst.num_bytes, "no route to host"); default: return Format::snprintf(dst.start, dst.num_bytes, "unknown error"); } diff --git a/repos/libports/src/lib/libc/socket_fs_plugin.cc b/repos/libports/src/lib/libc/socket_fs_plugin.cc index 65463f6feb..84a1e042c7 100644 --- a/repos/libports/src/lib/libc/socket_fs_plugin.cc +++ b/repos/libports/src/lib/libc/socket_fs_plugin.cc @@ -300,8 +300,8 @@ struct Libc::Socket_fs::Context : Plugin_context if (strcmp(connect_status, "not connected") == 0) return Errno(ENOTCONN); - if (strcmp(connect_status, "package not installed") == 0) - return Errno(ENOTSUP); + if (strcmp(connect_status, "no route to host") == 0) + return Errno(EHOSTUNREACH); error("socket_fs: unhandled connection state"); return Errno(ECONNREFUSED);