From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0DEF01396D0 for ; Fri, 29 Sep 2017 17:52:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6704E2BC018; Fri, 29 Sep 2017 17:52:26 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 274162BC018 for ; Fri, 29 Sep 2017 17:52:25 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BD5A9341780 for ; Fri, 29 Sep 2017 17:52:23 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0EF2F8F83 for ; Fri, 29 Sep 2017 17:52:22 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1506707472.7f3b41311119e3a96a15b0fb473b44f422e903e9.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: sh/ X-VCS-Repository: proj/openrc X-VCS-Files: sh/rc-cgroup.sh.in X-VCS-Directories: sh/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 7f3b41311119e3a96a15b0fb473b44f422e903e9 X-VCS-Branch: master Date: Fri, 29 Sep 2017 17:52:22 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 8aac08bb-b9d3-425b-b0d0-b2bcae20c99b X-Archives-Hash: e39aa7514d97ed94b5626a8aefab073b commit: 7f3b41311119e3a96a15b0fb473b44f422e903e9 Author: William Hubbs gmail com> AuthorDate: Fri Sep 29 17:50:05 2017 +0000 Commit: William Hubbs gentoo org> CommitDate: Fri Sep 29 17:51:12 2017 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=7f3b4131 use printf consistently in cgroups handling This makes the cgroups handling consistent between cgroups v1 and v2. Also, it fixes #167. sh/rc-cgroup.sh.in | 6 +++--- 1 file 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