All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Gao via ltp <ltp@lists.linux.it>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v15 1/3] lib/tst_uid: Remove spurious TERRNO from tst_get_free_gid success path
Date: Sat, 19 Sep 2026 01:53:19 +0000	[thread overview]
Message-ID: <20260919015329.22042-2-wegao@suse.com> (raw)
In-Reply-To: <20260919015329.22042-1-wegao@suse.com>

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;
 		}
-- 
2.55.0


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

  reply	other threads:[~2026-09-19  1:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-19  1:53 [LTP] [PATCH v15 0/3] open16: allow restricted O_CREAT of FIFOs and regular files Wei Gao via ltp
2026-09-19  1:53 ` Wei Gao via ltp [this message]
2026-09-19  5:52   ` [LTP] lib/tst_uid: Remove spurious TERRNO from tst_get_free_gid success path linuxtestproject.agent
2026-09-22 10:02   ` [LTP] [PATCH v15 1/3] " Petr Vorel
2026-10-08  8:41   ` Martin Doucha
2026-09-19  1:53 ` [LTP] [PATCH v15 2/3] lib: New library function tst_get_free_uid Wei Gao via ltp
2026-09-19  1:53 ` [LTP] [PATCH v15 3/3] open16: allow restricted O_CREAT of FIFOs and regular files Wei Gao via ltp

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=20260919015329.22042-2-wegao@suse.com \
    --to=ltp@lists.linux.it \
    --cc=wegao@suse.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.