summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSverker Eriksson <sverker@erlang.org>2019-09-12 16:12:11 +0200
committerSverker Eriksson <sverker@erlang.org>2019-09-12 16:12:11 +0200
commit91c52da3af8eb4e522253a19fdd0abefd850eda1 (patch)
tree2cca0cd1f7e9a76905a16f2db6347f21dec772e7
parentb63770e562433f6b61aed58e14a391393b2ff786 (diff)
downloaderlang-91c52da3af8eb4e522253a19fdd0abefd850eda1.tar.gz
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.
-rw-r--r--erts/etc/unix/cerl.src9
1 files 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=