mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibCore: Prefer Error::is_errno over Error::is_syscall
These are the only users of the latter, so let's just use is_errno (which will effectively give us the same result) to avoid confusion over these.
This commit is contained in:
parent
95441dabd5
commit
08e82ddaf0
Notes:
github-actions[bot]
2025-05-11 01:20:49 +00:00
Author: https://github.com/trflynn89
Commit: 08e82ddaf0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4689
2 changed files with 4 additions and 4 deletions
|
@ -218,11 +218,11 @@ TransportSocket::ShouldShutdown TransportSocket::read_as_many_messages_as_possib
|
||||||
auto maybe_bytes_read = m_socket->receive_message({ buffer, 4096 }, MSG_DONTWAIT, received_fds);
|
auto maybe_bytes_read = m_socket->receive_message({ buffer, 4096 }, MSG_DONTWAIT, received_fds);
|
||||||
if (maybe_bytes_read.is_error()) {
|
if (maybe_bytes_read.is_error()) {
|
||||||
auto error = maybe_bytes_read.release_error();
|
auto error = maybe_bytes_read.release_error();
|
||||||
if (error.is_syscall() && error.code() == EAGAIN) {
|
|
||||||
|
if (error.is_errno() && error.code() == EAGAIN) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (error.is_errno() && error.code() == ECONNRESET) {
|
||||||
if (error.is_syscall() && error.code() == ECONNRESET) {
|
|
||||||
should_shutdown = true;
|
should_shutdown = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -178,7 +178,7 @@ TEST_CASE(should_error_when_connection_fails)
|
||||||
|
|
||||||
auto maybe_tcp_socket = Core::TCPSocket::connect({ { 127, 0, 0, 1 }, 1234 });
|
auto maybe_tcp_socket = Core::TCPSocket::connect({ { 127, 0, 0, 1 }, 1234 });
|
||||||
EXPECT(maybe_tcp_socket.is_error());
|
EXPECT(maybe_tcp_socket.is_error());
|
||||||
EXPECT(maybe_tcp_socket.error().is_syscall());
|
EXPECT(maybe_tcp_socket.error().is_errno());
|
||||||
EXPECT(maybe_tcp_socket.error().code() == ECONNREFUSED);
|
EXPECT(maybe_tcp_socket.error().code() == ECONNREFUSED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue