public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v5 3/3] controllers/cpuacct: fix rmdir failures on early test abort
Date: Thu, 2 Sep 2021 10:18:36 +0200	[thread overview]
Message-ID: <YTCI3O7Et+VvYJfc@pevik> (raw)
In-Reply-To: <20210901151655.95760-3-krzysztof.kozlowski@canonical.com>

Hi Krzysztof,

...
> -	if [ -d "$testpath/subgroup_1" ]; then
> -		rmdir $testpath/subgroup_*
> +	if [ "$testpath" ]; then
> +		if [ -d "$testpath/subgroup_1" ]; then
> +			rmdir $testpath/subgroup_*
> +		fi
> +		rmdir $testpath
>  	fi

> -	rmdir $testpath
> -

LGTM, but how about use `rm -rf' instead?

e.g.

if [ "$testpath" ]; then
	rm -rf $testpath
fi

That could simplify checks. Or is it needed to use `rmdir' to make sure there is
no content in the directory? I suppose check like this is needed in cleanup,
thus no problem to use `rm -rf'.

Kind regards,
Petr

  reply	other threads:[~2021-09-02  8:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-01 15:16 [LTP] [PATCH v5 1/3] lib: add tst_get_free_pids helper program Krzysztof Kozlowski
2021-09-01 15:16 ` [LTP] [PATCH v5 2/3] controllers/cpuacct: skip cpuacct_100_100 on small memory systems Krzysztof Kozlowski
2021-09-01 18:14   ` Cyril Hrubis
2021-09-01 18:38     ` Petr Vorel
2021-09-02  8:06       ` Krzysztof Kozlowski
2021-09-02 12:02       ` Cyril Hrubis
2021-09-01 15:16 ` [LTP] [PATCH v5 3/3] controllers/cpuacct: fix rmdir failures on early test abort Krzysztof Kozlowski
2021-09-02  8:18   ` Petr Vorel [this message]
2021-09-02  8:24     ` Krzysztof Kozlowski
2021-09-02 16:00       ` Petr Vorel
2021-09-01 18:26 ` [LTP] [PATCH v5 1/3] lib: add tst_get_free_pids helper program Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YTCI3O7Et+VvYJfc@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox