zdtm: don't hide errors in cgroup02.hook

rmdir is executed for non-existent directories, so we don't check
an exit code of this operation.

This patch executs rmdir only for existent directories and check
an exit code of rmdir.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin 2014-08-26 15:26:00 +04:00 committed by Pavel Emelyanov
parent 02ecc82287
commit 457a70dabb

View file

@ -7,11 +7,9 @@ rmroots() {
mount -t cgroup none $tname -o "$1"
set +e
rmdir "$tname/oldroot"
rmdir "$tname/newroot"
rmdir "$tname/zdtmtstroot"
set -e
for d in "$tname/oldroot" "$tname/newroot" "$tname/zdtmtstroot"; do
test -d "$d" && rmdir "$d"
done
echo "Left there is:"
ls "$tname"