commit 8ab3ae233b1612b8fc9107ac289932f3d0626a30
parent 3486bfe79b33a2bba8822c3eb8aaa670b98776e4
Author: Cem Keylan <cem@ckyln.com>
Date: Tue, 7 Jul 2020 15:07:47 +0300
sysmgr: always fallback to kill for checking processes
Looking at procfs for checking processes isn't portable, and we should
always fallback to kill if we are checking processes.
Diffstat:
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/sysmgr b/sysmgr
@@ -56,11 +56,9 @@ checkprocess() {
# of being root.
# 3: Checking the existence of a directory is much faster and more efficient
# than sending a signal to a process.
- [ -d /proc ] || {
- kill -0 "$1" || return 1
- return 0
- }
- [ -d "/proc/$1" ] || return 1
+ #
+ # However, this isn't the portable way, that's why we fallback to kill(1).
+ [ -d "/proc/$1" ] || kill -0 "$1"
}
cleanup() {