Fix EINTR handling

This commit is contained in:
2025-08-23 17:28:34 -04:00
parent 5b4a28a8ca
commit a820efa2e6
6 changed files with 131 additions and 24 deletions

View File

@@ -28,7 +28,10 @@ Connection::~Connection() {
if (auto server_ptr = server_.lock()) {
server_ptr->active_connections_.fetch_sub(1, std::memory_order_relaxed);
}
int e = close(fd_);
int e;
do {
e = close(fd_);
} while (e == -1 && errno == EINTR);
if (e == -1) {
perror("close");
std::abort();