Fix EINTR handling
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user