Skip to content

Commit ce2709f

Browse files
committed
[sanitizer] shellcheck fixes
1 parent 85d7957 commit ce2709f

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

zorg/buildbot/builders/sanitizers/buildbot_qemu.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,11 @@ function configure_hwasan_lam {
257257
cmake \
258258
${CMAKE_COMMON_OPTIONS} \
259259
-DLLVM_ENABLE_PROJECTS="clang;compiler-rt;lld" \
260-
-DCMAKE_C_COMPILER=${COMPILER_BIN_DIR}/clang \
261-
-DCMAKE_CXX_COMPILER=${COMPILER_BIN_DIR}/clang++ \
260+
-DCMAKE_C_COMPILER="${COMPILER_BIN_DIR}/clang" \
261+
-DCMAKE_CXX_COMPILER="${COMPILER_BIN_DIR}/clang++" \
262262
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
263263
-DCOMPILER_RT_EMULATOR="env SSH_CONTROL_SOCKET=${SSH_CONTROL_SOCKET} ${HERE}/ssh_run.sh" \
264-
$LLVM
264+
"$LLVM"
265265
) >& configure.log
266266
) &
267267
}
@@ -273,7 +273,7 @@ function run_scudo_tests {
273273
build_step "scudo $name"
274274

275275
(
276-
cd ${out_dir}
276+
cd "${out_dir}"
277277

278278
cat configure.log
279279

@@ -293,7 +293,7 @@ function kill_qemu {
293293
echo "Waiting for QEMU to shutdown..." >&2
294294
{
295295
timeout -k 5s 5s wait "${QEMU_PID}" && return
296-
kill -9 "${QEMU_PID}" && wait "${QEMU_PID}" || true
296+
(kill -9 "${QEMU_PID}" && wait "${QEMU_PID}") || true
297297
} &>/dev/null
298298
fi
299299
}
@@ -309,14 +309,15 @@ function boot_qemu {
309309
echo "Booting QEMU..." >&2
310310

311311
# Try up to 10 random port numbers until one succeeds.
312-
for i in {0..10}; do
313-
rm -rf ${QEMU_TMPDIR}
314-
mkdir -p ${QEMU_TMPDIR}
312+
for _ in {0..10}; do
313+
rm -rf "${QEMU_TMPDIR}"
314+
mkdir -p "${QEMU_TMPDIR}"
315315
# Create a delta image to boot from.
316316
local DELTA_IMAGE="${QEMU_TMPDIR}/delta.qcow2"
317317
"${QEMU_IMG}" create -F raw -b "${QEMU_IMAGE}" -f qcow2 "${DELTA_IMAGE}"
318318

319-
local SSH_PORT="$(shuf -i 1000-65535 -n 1)"
319+
local SSH_PORT
320+
SSH_PORT="$(shuf -i 1000-65535 -n 1)"
320321

321322
"${QEMU}" -hda "${DELTA_IMAGE}" -nographic \
322323
-net "user,host=10.0.2.10,hostfwd=tcp:127.0.0.1:${SSH_PORT}-:22" \
@@ -395,7 +396,7 @@ done
395396
wait
396397

397398
for B in $SCUDO_BUILDS ; do
398-
run_scudo_tests $B
399+
run_scudo_tests "${B}"
399400
done
400401

401402
[[ -z "$SKIP_HWASAN_LAM" ]] && (

zorg/buildbot/builders/sanitizers/ssh_run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ function run_in_qemu {
99

1010
# Run binary in QEMU.
1111
ENV="HWASAN_OPTIONS=\"${HWASAN_OPTIONS:-}\" PATH=\"${PATH:-}\""
12-
run_in_qemu "cd $(pwd) && ${ENV} $@"
12+
run_in_qemu "cd $(pwd) && ${ENV} $*"

0 commit comments

Comments
 (0)