mirror of
https://github.com/ilya-zlobintsev/LACT.git
synced 2025-02-25 18:55:26 -06:00
Fix file descriptor leak in the listener too
This commit is contained in:
parent
862a46d754
commit
7313019305
@ -1,5 +1,3 @@
|
||||
use nix::unistd;
|
||||
|
||||
use crate::config::Config;
|
||||
use crate::gpu_controller::{FanControlInfo, GpuStats};
|
||||
use crate::gpu_controller::{GpuInfo, PowerProfile};
|
||||
|
@ -440,9 +440,11 @@ impl Daemon {
|
||||
|
||||
log::trace!("Responding, buffer length {}", buffer.len());
|
||||
nix::unistd::write(stream, &buffer).expect("Writing response to socket failed");
|
||||
//stream
|
||||
// .shutdown(std::net::Shutdown::Write)
|
||||
// .expect("Could not shut down");
|
||||
|
||||
nix::sys::socket::shutdown(stream, nix::sys::socket::Shutdown::Both)
|
||||
.expect("Failed to shut down");
|
||||
nix::unistd::close(stream).expect("Failed to close");
|
||||
|
||||
log::trace!("Finished responding");
|
||||
}
|
||||
Err(_) => {
|
||||
|
Loading…
Reference in New Issue
Block a user