30 lines
768 B
Diff
30 lines
768 B
Diff
From ef57fb8a85d78dfc6e7cbbf2ac6756da93ffd45f Mon Sep 17 00:00:00 2001
|
|
From: licunlong <licunlong1@huawei.com>
|
|
Date: Wed, 31 May 2023 11:15:32 +0800
|
|
Subject: [PATCH 6/9] fix: change if port.fd() is valid, we should avoid
|
|
dealing with invalid port.
|
|
|
|
---
|
|
coms/socket/src/mng.rs | 5 +++--
|
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/coms/socket/src/mng.rs b/coms/socket/src/mng.rs
|
|
index aace9c7..82fdcbe 100644
|
|
--- a/coms/socket/src/mng.rs
|
|
+++ b/coms/socket/src/mng.rs
|
|
@@ -593,8 +593,9 @@ impl SocketMng {
|
|
|
|
fn flush_ports(&self) {
|
|
for port in self.ports().iter() {
|
|
- port.flush_accept();
|
|
-
|
|
+ if port.fd() < 0 {
|
|
+ continue;
|
|
+ }
|
|
port.flush_fd();
|
|
}
|
|
}
|
|
--
|
|
2.30.2
|
|
|