mirror of
https://github.com/genodelabs/genode.git
synced 2025-05-31 22:50:54 +00:00
tcp_terminal: fix destruction of Open_socket
The socket API close() must be called within a libc context. Moreover, the socket for listening needs to be closed as well. Fixes #5270
This commit is contained in:
parent
7b8a2e77e4
commit
5bc6c9f2d0
@ -455,8 +455,16 @@ Open_socket::Open_socket(char const * ip_addr, int tcp_port)
|
|||||||
|
|
||||||
Open_socket::~Open_socket()
|
Open_socket::~Open_socket()
|
||||||
{
|
{
|
||||||
if (_sd != -1) close(_sd);
|
Libc::with_libc([&] () {
|
||||||
open_socket_pool()->remove(this);
|
|
||||||
|
if (_sd != -1)
|
||||||
|
close(_sd);
|
||||||
|
|
||||||
|
if (_listen_sd != -1)
|
||||||
|
close(_listen_sd);
|
||||||
|
|
||||||
|
open_socket_pool()->remove(this);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user