From 3f752a72fdd073d875cf941e3049f9860e30d841 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Wed, 12 Aug 2026 03:52:41 +0300 Subject: fix: synchronously terminate cancelled status commands --- src/platform/unix_common.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/platform/unix_common.rs') 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 { let month = time::Month::try_from(u8::try_from(value.tm_mon + 1).ok()?).ok()?; let date = time::Date::from_calendar_date( -- cgit v1.2.3