mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 19:05:08 +00:00
Kernel: Make sys$recvfrom() with MSG_DONTWAIT not so racy
Instead of temporary changing the open file description's "blocking" flag while doing a non-waiting recvfrom, we instead plumb the currently wanted blocking behavior all the way through to the underlying socket.
This commit is contained in:
parent
8997c6a4d1
commit
42435ce5e4
7 changed files with 17 additions and 22 deletions
|
@ -242,7 +242,7 @@ ErrorOr<size_t> Socket::read(OpenFileDescription& description, u64, UserOrKernel
|
|||
if (is_shut_down_for_reading())
|
||||
return 0;
|
||||
Time t {};
|
||||
return recvfrom(description, buffer, size, 0, {}, 0, t);
|
||||
return recvfrom(description, buffer, size, 0, {}, 0, t, description.is_blocking());
|
||||
}
|
||||
|
||||
ErrorOr<size_t> Socket::write(OpenFileDescription& description, u64, UserOrKernelBuffer const& data, size_t size)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue