mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 11:27:29 +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()
|
||||
{
|
||||
if (_sd != -1) close(_sd);
|
||||
open_socket_pool()->remove(this);
|
||||
Libc::with_libc([&] () {
|
||||
|
||||
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