aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShuai Xue <xueshuai@linux.alibaba.com>2022-10-28 11:16:34 +0800
committerTony Luck <tony.luck@intel.com>2022-10-28 09:17:14 -0700
commit025014dedca39d2b8a57a82e52286e72e157d73a (patch)
tree9c6383f33daf366de03b00f734935bc21e9a9da9
parent8fe03104cb3eed2974e930a35dbb2a927b54b73d (diff)
downloadmce-test-025014dedca39d2b8a57a82e52286e72e157d73a.tar.gz
tools: victim: fix timeout count with pre-decrement
The post-decrement of count as while loop condition will end with count equal to -1, result in failing to catch triggering timeout. Change to use pre-decrement. Signed-off-by: Shuai Xue <xueshuai@linux.alibaba.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
-rw-r--r--tools/victim/victim.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/victim/victim.c b/tools/victim/victim.c
index 5aa8c1e..50aacd7 100644
--- a/tools/victim/victim.c
+++ b/tools/victim/victim.c
@@ -323,7 +323,7 @@ int main(int argc, char **argv)
return 1;
}
memset(trigger_buf, 0, sizeof(trigger_buf));
- while (count--) {
+ while (--count) {
if ((fd = open(trigger, O_RDONLY)) < 0) {
sleep(1);
continue;