From 5853a68904edc945c7f373e55de12db68f0c20d9 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 4 Dec 2019 16:33:39 +0100 Subject: [PATCH] libc: silence calls of getpeername w/o socket fs The getpeername function is provided only by the socket fs. In the case where the socket fs is not configured, return an appropriate errno instead probing for a libc plugin (there is none). Issue #3578 --- repos/libports/src/lib/libc/socket_operations.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repos/libports/src/lib/libc/socket_operations.cc b/repos/libports/src/lib/libc/socket_operations.cc index 4803c12ad9..dcd0467530 100644 --- a/repos/libports/src/lib/libc/socket_operations.cc +++ b/repos/libports/src/lib/libc/socket_operations.cc @@ -22,12 +22,12 @@ extern "C" { #include #include -#include } /* libc-internal includes */ #include #include +#include using namespace Libc; @@ -52,7 +52,7 @@ extern "C" int getpeername(int libc_fd, sockaddr *addr, socklen_t *addrlen) if (*config_socket()) return socket_fs_getpeername(libc_fd, addr, addrlen); - FD_FUNC_WRAPPER(getpeername, libc_fd, addr, addrlen); + return Libc::Errno(ENOTSOCK); }