mirror of
https://github.com/RGBCube/serenity
synced 2025-07-15 03:37:34 +00:00
Kernel: Accept SHUT_RD and SHUT_WR as shutdown() how values
The previous check for valid how values assumed this field was a bitmap and that SHUT_RDWR was simply a bitwise or of SHUT_RD and SHUT_WR, which is not the case.
This commit is contained in:
parent
693d34fe3d
commit
a6f237a247
1 changed files with 1 additions and 1 deletions
|
@ -160,7 +160,7 @@ ErrorOr<FlatPtr> Process::sys$shutdown(int sockfd, int how)
|
||||||
{
|
{
|
||||||
VERIFY_NO_PROCESS_BIG_LOCK(this)
|
VERIFY_NO_PROCESS_BIG_LOCK(this)
|
||||||
TRY(require_promise(Pledge::stdio));
|
TRY(require_promise(Pledge::stdio));
|
||||||
if (how & ~SHUT_RDWR)
|
if (how != SHUT_RD && how != SHUT_WR && how != SHUT_RDWR)
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
auto description = TRY(open_file_description(sockfd));
|
auto description = TRY(open_file_description(sockfd));
|
||||||
if (!description->is_socket())
|
if (!description->is_socket())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue