From 28bb8b469438d5cf29d673ee13bdd11a619e4dbb Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Sat, 17 Sep 2005 20:41:57 -0500 Subject: [svn-r11428] Purpose: Bug fix. Description: In some racing condition, the process ID file might be removed just the moment before timekeeper cats its content. When that happens, the $pid is a blank. Timekeeper was not prepared for this. Solution: Added code to verify $pid is some number before proceeding. Platforms tested: Tested by hand only. --- bin/timekeeper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/timekeeper b/bin/timekeeper index aa0b21c..73aa32a 100755 --- a/bin/timekeeper +++ b/bin/timekeeper @@ -100,7 +100,7 @@ if [ -z "$debugflag" ]; then if [ -f $x ]; then pid=`cat $x` # check if process is still around - if ps $pid > /dev/null; then + if test X$pid \!= X && ps -p $pid > /dev/null; then echo "terminating process $x ($pid)" kill -HUP $pid fi -- cgit v0.12