mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-16 15:29:57 +00:00
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
This commit is contained in:
parent
ae64830bd5
commit
5853a68904
@ -22,12 +22,12 @@
|
||||
extern "C" {
|
||||
#include <sys/wait.h>
|
||||
#include <libc_private.h>
|
||||
#include <errno.h>
|
||||
}
|
||||
|
||||
/* libc-internal includes */
|
||||
#include <internal/file.h>
|
||||
#include <internal/socket_fs_plugin.h>
|
||||
#include <internal/errno.h>
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user