random_offline: fix endless run without -t argument
Signed-off-by: Andi Kleen <ak@linux.intel.com>
diff --git a/tsrc/random_offline b/tsrc/random_offline
index adb68f7..27eef6b 100755
--- a/tsrc/random_offline
+++ b/tsrc/random_offline
@@ -133,10 +133,12 @@
rm offlined
fi
- ((DIFF = $(date +%s) - $start))
- if [ ! -z "$RUNTIME" -a $DIFF -gt "$RUNTIME" ] ; then
- echo time over
- break
+ if [ ! -z "$RUNTIME" ] ; then
+ ((DIFF = $(date +%s) - $start))
+ if [ $DIFF -gt "$RUNTIME" ] ; then
+ echo time over
+ break
+ fi
fi
done