From: Omar Sandoval Date: Thu, 17 Jan 2019 01:34:19 +0000 (-0800) Subject: cgroup: test if CGROUP2_DIR is set with -v instead of -n X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8a274578e2895b9f0b66c09f3a8f63b5ff1293b2;p=users%2Fsagi%2Fblktests.git cgroup: test if CGROUP2_DIR is set with -v instead of -n common/multipath-over-rdma does set -u, so -n "$CGROUP2_DIR" fails with an unbound variable error. Instead, use -v to test if the variable was set. Signed-off-by: Omar Sandoval --- diff --git a/common/cgroup b/common/cgroup index 48e546f..554ebf7 100644 --- a/common/cgroup +++ b/common/cgroup @@ -22,7 +22,7 @@ _init_cgroup2() _exit_cgroup2() { - if [[ -n $CGROUP2_DIR ]]; then + if [[ -v CGROUP2_DIR ]]; then find "$CGROUP2_DIR" -type d -delete unset CGROUP2_DIR fi