[LTP] [PATCH v2 0/3] lib: LTP_DEBUG cleanup

Petr Vorel pvorel@suse.cz
Fri Mar 27 13:40:52 CET 2026


> Hi Petr,

> Patches 1/3 and 2/3 look good. Patch 3/3 has a regression
> and a couple of nits.

> > [PATCH 3/3]
> > --- a/lib/tst_test.c
> > +++ b/lib/tst_test.c
> > +	{"D::", "-D[1,2]  Prints debug information (can be overwriten by LTP_DEBUG"},

> Typo: "overwriten" -> "overwritten". Also missing closing ')'.

> [...]

> > 	case 'D':
> > +		if (!getenv("LTP_DEBUG")) {

> This undoes the empty-string fix from patch 1/3. When
> LTP_DEBUG="" is set, getenv() returns "" (non-NULL), so -D is
> skipped here. But in do_setup() the tdebug_env[0] != '\0'
> check also skips it. Net result: LTP_DEBUG= ./test -D2
> silently produces no debug output.

Good point, thanks!

nit: better to discuss in patch itself, discussion on cover letter is somehow
hidden in patchwork.

Kind regards,
Petr

> Should be something like:

> 	char *env = getenv("LTP_DEBUG");
> 	if (!env || !env[0]) {

> Regards,


More information about the ltp mailing list