From 91c52da3af8eb4e522253a19fdd0abefd850eda1 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Thu, 12 Sep 2019 16:12:11 +0200 Subject: Fix cerl script for SunOS syntax error at line 318: `taskset1=$' unexpected A real Bourne Shell does not parse arithmetic (( syntax. And expr command does not support << bit shift. --- erts/etc/unix/cerl.src | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/erts/etc/unix/cerl.src b/erts/etc/unix/cerl.src index 59de9bdec8..d85a36acd4 100644 --- a/erts/etc/unix/cerl.src +++ b/erts/etc/unix/cerl.src @@ -315,8 +315,13 @@ if [ "x$GDB" = "x" ]; then ncpu=`cat /proc/cpuinfo | grep -w processor | wc -l` # Choose a random core in order to not collide with any other valgrind # run on the same machine. - taskset1=$((1 << (`shuf -i 1-$ncpu -n 1` - 1) )) - taskset1="taskset $taskset1" + cpu=`shuf -i 1-$ncpu -n 1` + mask=1 + while [ $cpu -gt 1 ]; do + mask=`expr $mask \* 2` + cpu=`expr $cpu - 1` + done + taskset1="taskset $mask" sched_arg="-S$ncpu:$ncpu" else taskset1= -- cgit v1.2.1