mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 03:57:35 +00:00
Kernel: Make File::write() and File::read() return KResultOr<size_t>
Instead of returning a ssize_t where negative values mean error, we now return KResultOr<size_t> and use the error state to report errors exclusively.
This commit is contained in:
parent
58feebeed2
commit
7a3ab6c517
58 changed files with 223 additions and 229 deletions
|
@ -161,7 +161,7 @@ NonnullRefPtr<TCPSocket> TCPSocket::create(int protocol)
|
|||
return adopt(*new TCPSocket(protocol));
|
||||
}
|
||||
|
||||
int TCPSocket::protocol_receive(const KBuffer& packet_buffer, void* buffer, size_t buffer_size, int flags)
|
||||
KResultOr<size_t> TCPSocket::protocol_receive(const KBuffer& packet_buffer, void* buffer, size_t buffer_size, int flags)
|
||||
{
|
||||
(void)flags;
|
||||
auto& ipv4_packet = *(const IPv4Packet*)(packet_buffer.data());
|
||||
|
@ -175,7 +175,7 @@ int TCPSocket::protocol_receive(const KBuffer& packet_buffer, void* buffer, size
|
|||
return payload_size;
|
||||
}
|
||||
|
||||
int TCPSocket::protocol_send(const void* data, size_t data_length)
|
||||
KResultOr<size_t> TCPSocket::protocol_send(const void* data, size_t data_length)
|
||||
{
|
||||
send_tcp_packet(TCPFlags::PUSH | TCPFlags::ACK, data, data_length);
|
||||
return data_length;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue