public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Li Wang via ltp <ltp@lists.linux.it>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2 1/3] lib: Ignore empty LTP_ENABLE_DEBUG
Date: Fri, 27 Mar 2026 11:51:06 +0800	[thread overview]
Message-ID: <acX-qoCubANAhZWu@redhat.com> (raw)
In-Reply-To: <20260326170435.22566-2-pvorel@suse.cz>

On Thu, Mar 26, 2026 at 06:04:33PM +0100, Petr Vorel wrote:
> Empty LTP_ENABLE_DEBUG environment variable should be just ignored.
> 
> This fixes warning:
> LTP_ENABLE_DEBUG= ./test05
> tst_test.c:1454: TWARN: Invalid LTP_ENABLE_DEBUG value:
> 
> Fixes: e434de62b4 ("lib: Extend LTP_ENABLE_DEBUG to support verbosity levels")
> Signed-off-by: Petr Vorel <pvorel@suse.cz>

Reviewed-by: Li Wang <liwang@redhat.com>

> ---
>  lib/tst_test.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/tst_test.c b/lib/tst_test.c
> index 2d62ab164d..4a22f2e477 100644
> --- a/lib/tst_test.c
> +++ b/lib/tst_test.c
> @@ -1445,13 +1445,13 @@ static void do_setup(int argc, char *argv[])
>  
>  	parse_opts(argc, argv);
>  
> -	if (tdebug_env && !context->tdebug) {
> +	if (tdebug_env && tdebug_env[0] != '\0' && !context->tdebug) {

Or, more shorten:

    if (tdebug_env && *tdebug_env && !context->tdebug) {

-- 
Regards,
Li Wang


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2026-03-27  3:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-26 17:04 [LTP] [PATCH v2 0/3] lib: LTP_DEBUG cleanup Petr Vorel
2026-03-26 17:04 ` [LTP] [PATCH v2 1/3] lib: Ignore empty LTP_ENABLE_DEBUG Petr Vorel
2026-03-27  3:51   ` Li Wang via ltp [this message]
2026-03-27  9:38     ` Petr Vorel
2026-03-26 17:04 ` [LTP] [PATCH v2 2/3] lib: Rename variable LTP_ENABLE_DEBUG => LTP_DEBUG Petr Vorel
2026-03-27  3:47   ` Li Wang via ltp
2026-03-26 17:04 ` [LTP] [PATCH v2 3/3] lib: Prefer LTP_DEBUG over -D Petr Vorel
2026-03-27  3:45   ` Li Wang via ltp
2026-03-27 10:39 ` [LTP] [PATCH v2 0/3] lib: LTP_DEBUG cleanup Andrea Cervesato via ltp
2026-03-27 12:40   ` Petr Vorel
2026-03-27 15:46     ` 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=acX-qoCubANAhZWu@redhat.com \
    --to=ltp@lists.linux.it \
    --cc=liwang@redhat.com \
    --cc=pvorel@suse.cz \
    /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