commit:     4651b8c7e9e2ef9c1ea1fb8d174d1ca4693627af
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Fri Sep 15 18:42:50 2017 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Fri Sep 15 18:42:50 2017 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=4651b8c7

rc-cgroup.sh: cgroup_cleanup fix error handling

cgroup_cleanup should warn if it is unable to clean up all processes in
the control group, but it will always return success.

 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 3c7558cd..2a54ee4a 100644
--- a/sh/rc-cgroup.sh.in
+++ b/sh/rc-cgroup.sh.in
@@ -212,5 +212,7 @@ cgroup_cleanup()
                yesno "${rc_send_sigkill:-yes}" &&
                        kill -s KILL ${pids} 2> /dev/null
        fi
-       eend 0
+       [ -z "$(cgroup_get_pids)" ]
+       eend $? "Unable to stop all processes"
+       return 0
 }

Reply via email to