From 96ff7c8dc67809a3199d0b7f22d9e50483634a9c Mon Sep 17 00:00:00 2001 From: Patrick Schleizer Date: Sat, 19 Apr 2025 12:45:06 -0400 Subject: [PATCH] refactoring --- usr/libexec/security-misc/apt-get-update | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/usr/libexec/security-misc/apt-get-update b/usr/libexec/security-misc/apt-get-update index cb586e9..0e5e8f5 100755 --- a/usr/libexec/security-misc/apt-get-update +++ b/usr/libexec/security-misc/apt-get-update @@ -21,12 +21,9 @@ sigterm_trap() { if [ "$lastpid" = "" ]; then exit 143 fi - ps -p "$lastpid" >/dev/null 2>&1 - if [ ! "$?" = "0" ]; then - ## Already terminated. - exit 143 + if kill -0 -- "$lastpid" &>/dev/null ; then + kill -s sigterm -- "$lastpid" fi - kill -s sigterm "$lastpid" exit 143 }