aboutsummaryrefslogtreecommitdiff
path: root/src/platform/unix_common.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-08-12 03:52:41 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-08-12 03:52:41 +0300
commit3f752a72fdd073d875cf941e3049f9860e30d841 (patch)
treeac0c62cb318b0c169a44e77928a886bd93c63ae8 /src/platform/unix_common.rs
parent9ba32c25f37b15385295dfac0f539fcb434120f9 (diff)
fix: synchronously terminate cancelled status commands
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(