mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-24 00:24:38 +00:00
Kernel: Allow File::close() to fail
And pass the result through to sys$close() return value. Fixes https://github.com/SerenityOS/serenity/issues/427
This commit is contained in:
committed by
Andreas Kling
parent
d4ddb0013c
commit
1b4e88fb59
@@ -440,9 +440,9 @@ void TCPSocket::shut_down_for_writing()
|
||||
}
|
||||
}
|
||||
|
||||
void TCPSocket::close()
|
||||
KResult TCPSocket::close()
|
||||
{
|
||||
IPv4Socket::close();
|
||||
auto result = IPv4Socket::close();
|
||||
if (state() == State::CloseWait) {
|
||||
#ifdef TCP_SOCKET_DEBUG
|
||||
dbg() << " Sending FIN from CloseWait and moving into LastAck";
|
||||
@@ -453,6 +453,7 @@ void TCPSocket::close()
|
||||
|
||||
LOCKER(closing_sockets().lock());
|
||||
closing_sockets().resource().set(tuple(), *this);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user