mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-02 18:05:23 +00:00
Revert "vmm: config: Don't close reserved FDs from NetConfig::drop()
"
This reverts commit 0110fb4edc9ffa13d33f1c41c708f4bd844b0aee. Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
parent
321421c53e
commit
77a205881b
@ -1154,11 +1154,6 @@ impl Drop for NetConfig {
|
|||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
if let Some(mut fds) = self.fds.take() {
|
if let Some(mut fds) = self.fds.take() {
|
||||||
for fd in fds.drain(..) {
|
for fd in fds.drain(..) {
|
||||||
// Skip reserved FDs
|
|
||||||
if fd <= 2 {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// SAFETY: Safe as the fd was given to the config by the API
|
// SAFETY: Safe as the fd was given to the config by the API
|
||||||
unsafe { libc::close(fd) };
|
unsafe { libc::close(fd) };
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user