Skip to content

Commit

Permalink
fix pipelione handling of tmpdir
Browse files Browse the repository at this point in the history
  • Loading branch information
toralf committed Jun 2, 2024
1 parent 784e9e8 commit a74e1ca
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions fuzz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ function repoWasUpdated() {
}

function getFuzzerCandidates() {
local tmpdir
tmpdir=$(mktemp -d /tmp/$(basename $0)_XXXXXX)

# prefer a "non-running non-aborted" (1st) over a "non-running but aborted" (2nd), but choose at least one (3rd)
getFuzzers $software |
shuf |
Expand All @@ -137,7 +134,6 @@ function getFuzzerCandidates() {
done

cat $tmpdir/next.{1st,2nd,3rd} 2>/dev/null
rm -r $tmpdir
}

function runFuzzers() {
Expand All @@ -155,6 +151,8 @@ function runFuzzers() {
buildSoftware
fi

local tmpdir
tmpdir=$(mktemp -d /tmp/$(basename $0)_XXXXXX)
getFuzzerCandidates |
head -n $delta |
while read -r line; do
Expand All @@ -163,6 +161,7 @@ function runFuzzers() {
return 1
fi
done
rm -r $tmpdir

elif [[ $delta -lt 0 ]]; then
((delta = -delta))
Expand Down

0 comments on commit a74e1ca

Please sign in to comment.