From 96392fd6b59d5f6f7139864e13bc7a51874bbc3c Mon Sep 17 00:00:00 2001
From: Patrick Bellasi <patrick.bellasi@arm.com>
Date: Tue, 26 Apr 2016 15:30:03 +0100
Subject: [PATCH] cgroups: fix run_into shutils

On some targets the run_into function is not passing all params to the
called application. This patch should fix that using shift to get a list
of all command parameters.

Moreovere, we use now exec to spawn the command execution, which avoids to
generate yet another shell to run the required command.
---
 devlib/bin/scripts/shutils.in | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/devlib/bin/scripts/shutils.in b/devlib/bin/scripts/shutils.in
index ef4d3bd..7e8bdb8 100755
--- a/devlib/bin/scripts/shutils.in
+++ b/devlib/bin/scripts/shutils.in
@@ -90,8 +90,9 @@ cgroups_run_into() {
 	CGMOUNT=${CGMOUNT:-/sys/fs/cgroup/devlib_*}
 	# The control group we want to run into
 	CGP=${1}
+	shift 1
 	# The command to run
-	CMD=${2}
+	CMD="${@}"
 
 	# Execution under root CGgroup
 	if [ "x/" == "x$CGP" ]; then
@@ -125,7 +126,8 @@ cgroups_run_into() {
 	fi
 
 	# Execute the command
-	$CMD
+	exec $CMD
+
 }
 
 cgroups_tasks_move() {