[CRIU] [PATCH] zdtm: don't hide errors in cgroup02.hook
Tycho Andersen
tycho.andersen at canonical.com
Tue Aug 26 07:21:49 PDT 2014
On Tue, Aug 26, 2014 at 03:26:12PM +0400, Andrey Vagin wrote:
> 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 at openvz.org>
Acked-by: Tycho Andersen <tycho.andersen at canonical.com>
> ---
> test/zdtm/live/static/cgroup02.hook | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/test/zdtm/live/static/cgroup02.hook b/test/zdtm/live/static/cgroup02.hook
> index 5f4d042..75bfb42 100755
> --- a/test/zdtm/live/static/cgroup02.hook
> +++ b/test/zdtm/live/static/cgroup02.hook
> @@ -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"
> --
> 1.9.3
>
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu
More information about the CRIU
mailing list