aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2017-09-29 12:50:05 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2017-09-29 12:51:12 -0500
commit7f3b41311119e3a96a15b0fb473b44f422e903e9 (patch)
tree15c95a8ab51c00c57a0a01f5143cad6cde8db0c4
parent1ccba056584ee1a8e09fb1d5eebd988b47912c06 (diff)
use printf consistently in cgroups handling
This makes the cgroups handling consistent between cgroups v1 and v2. Also, it fixes #167.
-rw-r--r--sh/rc-cgroup.sh.in6
1 files changed, 3 insertions, 3 deletions
diff --git a/sh/rc-cgroup.sh.in b/sh/rc-cgroup.sh.in
index 9e93d841..d48957ac 100644
--- a/sh/rc-cgroup.sh.in
+++ b/sh/rc-cgroup.sh.in
@@ -165,7 +165,7 @@ cgroup2_remove()
[ ! -e "${rc_cgroup_path}"/cgroup.events ] &&
return 0
grep -qx "$$" "${rc_cgroup_path}/cgroup.procs" &&
- echo 0 > "${cgroup_path}/cgroup.procs"
+ printf "%d" 0 > "${cgroup_path}/cgroup.procs"
local key populated vvalue
while read -r key value; do
case "${key}" in
@@ -188,12 +188,12 @@ cgroup2_set_limits()
IFS="
"
[ ! -d "${rc_cgroup_path}" ] && mkdir "${rc_cgroup_path}"
- echo 0 > "${rc_cgroup_path}/cgroup.procs"
+ printf "%d" 0 > "${rc_cgroup_path}/cgroup.procs"
echo "${rc_cgroup_settings}" | while IFS="$OIFS" read -r key value; do
[ -z "${key}" ] || [ -z "${value}" ] && continue
[ ! -e "${rc_cgroup_path}/${key}" ] && continue
veinfo "${RC_SVCNAME}: cgroups: ${key} ${value}"
- echo "${value}" > "${rc_cgroup_path}/${key}"
+ printf "%s" "${value}" > "${rc_cgroup_path}/${key}"
done
IFS="$OIFS"
return 0