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
This commit is contained in:
Sebastian Sumpf 2023-11-06 17:13:58 +01:00 committed by Christian Helmuth
parent 7fb0c9ba30
commit c7956aa41b
2 changed files with 4 additions and 4 deletions

View File

@ -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");
}

View File

@ -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);