aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xhelpers/llvm-cron-build4
1 files changed, 3 insertions, 1 deletions
diff --git a/helpers/llvm-cron-build b/helpers/llvm-cron-build
index 9d2062b..d433903 100755
--- a/helpers/llvm-cron-build
+++ b/helpers/llvm-cron-build
@@ -32,7 +32,9 @@ if [ "$1" = "" ]; then
fi
# Make sure we're not already running
-if ps awwux | grep -v grep | grep -v $$ | grep "$BIN" > /dev/null; then
+PID=$$
+PREVPID=$((PID-1)) # Cron starts sh -c '$JOB'
+if ps awwux | grep -v grep | grep -v "$PID" | grep -v "$PREVPID" | grep "$BIN" > /dev/null; then
echo "Already running, won't flog" > "$err"
exit 1
fi