Skip to content

Commit

Permalink
Add logging for <process_mux_impl::Session as Drop>::drop
Browse files Browse the repository at this point in the history
Signed-off-by: Jiahao XU <[email protected]>
  • Loading branch information
NobodyXu authored Sep 8, 2024
1 parent e406725 commit d6aff59
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/process_impl/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,14 @@ impl Drop for Session {
None => return,
};

let _ = self
let _res = self
.new_std_cmd(&["-O", "exit"])
.stdout(Stdio::null())
.stderr(Stdio::null())
.status();
#[cfg(feature = "tracing")]
if let Err(err) = _res {
tracing::error!("Closing ssh session failed: {}", err);
}
}
}

0 comments on commit d6aff59

Please sign in to comment.