[LTP] [PATCH v15 1/3] lib/tst_uid: Remove spurious TERRNO from tst_get_free_gid success path
Martin Doucha
mdoucha@suse.cz
Thu Oct 8 10:41:05 CEST 2026
On 9/19/26 03:53, Wei Gao via ltp wrote:
> tst_get_free_gid_() prints the found GID when it succeeds, but it
> incorrectly includes TERRNO in tst_res_(). This prints whatever value
> happens to be in errno (often 0 or a stale value) which is confusing in
> a success path.
>
> Remove the spurious TERRNO flag from the tst_res_() success message.
>
> Signed-off-by: Wei Gao <wegao@suse.com>
> Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>
> ---
> lib/tst_uid.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/tst_uid.c b/lib/tst_uid.c
> index af4ef8cf7..b0b087362 100644
> --- a/lib/tst_uid.c
> +++ b/lib/tst_uid.c
> @@ -24,7 +24,7 @@ gid_t tst_get_free_gid_(const char *file, const int lineno, gid_t skip)
> continue;
>
> if (errno == 0 || errno == ENOENT || errno == ESRCH) {
> - tst_res_(file, lineno, TINFO | TERRNO,
> + tst_res_(file, lineno, TINFO,
> "Found unused GID %d", (int)ret);
> return ret;
> }
Hi,
the errno value printed here is always set by the getgrgid() call on
line 23. The TERRNO is intentional and it should stay there.
--
Martin Doucha mdoucha@suse.cz
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic
More information about the ltp
mailing list