summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2005-09-18 01:41:57 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2005-09-18 01:41:57 (GMT)
commit28bb8b469438d5cf29d673ee13bdd11a619e4dbb (patch)
treef647c45e4a0335ddbf4b6afe0cbeba859bb2b506 /bin
parentf8e70642695ffe44e299b8e68f4df1e743408470 (diff)
downloadhdf5-28bb8b469438d5cf29d673ee13bdd11a619e4dbb.zip
hdf5-28bb8b469438d5cf29d673ee13bdd11a619e4dbb.tar.gz
hdf5-28bb8b469438d5cf29d673ee13bdd11a619e4dbb.tar.bz2
[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.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/timekeeper2
1 files changed, 1 insertions, 1 deletions
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