Skip to content

Commit 4b617a1

Browse files
authored
Merge pull request #107 from gao-yan/agent-string-comparison
Fix: agent: correctly compare string values when calculating timeout
2 parents 36a5d1b + b600359 commit 4b617a1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

agent/sbd.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ sbd_validate_timeout() {
4545
esac
4646
crm_timeout=$[$(crm_attribute -t crm_config -G -n stonith-timeout -d 20s -q | sed -e 's/\(.*\)s/\1/' -e 's/\(.*\)m/\1*60/')]
4747
sbd_timeout=$(sbd -d $sbd_device dump | perl -ne 'if (/msgwait.*: (\d+)/) { print "$1\n"; }' | head -n 1)
48-
if [ "$sbd_timeout" -eq "0" ]; then
48+
if [ -z "$sbd_timeout" -o "$sbd_timeout" = "0" ]; then
4949
return
5050
fi
5151

0 commit comments

Comments
 (0)