aboutsummaryrefslogtreecommitdiff
path: root/src/platform/unix_common.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/platform/unix_common.rs')
-rw-r--r--src/platform/unix_common.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/platform/unix_common.rs b/src/platform/unix_common.rs
index 3004e6da..fa7b6d20 100644
--- a/src/platform/unix_common.rs
+++ b/src/platform/unix_common.rs
@@ -174,8 +174,8 @@ impl StatusCommandGuard {
}
}
-impl Drop for StatusCommandGuard {
- fn drop(&mut self) {
+impl StatusCommandGuard {
+ pub(crate) fn terminate(&mut self) {
if let Some(process_group_id) = self.process_group_id.take() {
// The command was spawned as this process group's leader. Killing the
// group also cleans up background descendants on completion/cancellation.
@@ -186,6 +186,12 @@ impl Drop for StatusCommandGuard {
}
}
+impl Drop for StatusCommandGuard {
+ fn drop(&mut self) {
+ self.terminate();
+ }
+}
+
fn datetime_from_tm(value: &libc::tm) -> Option<time::PrimitiveDateTime> {
let month = time::Month::try_from(u8::try_from(value.tm_mon + 1).ok()?).ok()?;
let date = time::Date::from_calendar_date(