commit:     b20a1951adf9a705a903fb3047b7ef26c013103c
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Tue Oct  6 16:59:55 2015 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Tue Oct  6 17:11:29 2015 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=b20a1951

rc-cgroup.sh: Do not add leading spaces to cgroup values

We were starting the value we write to the cgroup setting file with
leading spaces and this was causing issues. This change makes sure that
we aren't adding leading spaces to the value.

X-Gentoo-Bug: 562354
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=562354

 sh/rc-cgroup.sh.in | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sh/rc-cgroup.sh.in b/sh/rc-cgroup.sh.in
index c7cac2a..3f34d17 100644
--- a/sh/rc-cgroup.sh.in
+++ b/sh/rc-cgroup.sh.in
@@ -54,7 +54,9 @@ cgroup_set_values()
                                val=
                                ;;
                        *)
-                               val="$val $1"
+                               [ -n "$val" ] &&
+                                       val="$val $1" ||
+                                       val="$1"
                                ;;
                esac
                shift

Reply via email to