libc/socket_fs: warn on unexpected arg in shutdown
Our 'shutdown' implementation handles only the case that 'how' is 'RDWR'. Thus, print an error and continue if a user calls it with another value. Fixes #2285
This commit is contained in:
parent
1a6963813c
commit
43fcdc43e6
|
@ -627,6 +627,11 @@ extern "C" int socket_fs_shutdown(int libc_fd, int how)
|
|||
{
|
||||
/* TODO ENOTCONN */
|
||||
|
||||
if (how != SHUT_RDWR) {
|
||||
Genode::error("function '", __func__ , "' only implemented for 'how",
|
||||
"value 'SHUT_RDWR'");
|
||||
}
|
||||
|
||||
Libc::File_descriptor *fd = Libc::file_descriptor_allocator()->find_by_libc_fd(libc_fd);
|
||||
if (!fd)
|
||||
return Errno(EBADF);
|
||||
|
|
Loading…
Reference in New Issue