Linux Test Project
 help / color / mirror / Atom feed
From: Wei Gao via ltp <ltp@lists.linux.it>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v12 1/3] lib/tst_uid: Remove spurious TERRNO from tst_get_free_gid success path
Date: Wed, 22 Jul 2026 04:47:27 +0000	[thread overview]
Message-ID: <20260722044732.3547-2-wegao@suse.com> (raw)
In-Reply-To: <20260722044732.3547-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>
---
 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.54.0


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

  reply	other threads:[~2026-07-22  4:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22  4:47 [LTP] [PATCH v12 0/3] open16: allow restricted O_CREAT of FIFOs and regular files Wei Gao via ltp
2026-07-22  4:47 ` Wei Gao via ltp [this message]
2026-07-22  5:59   ` [LTP] lib/tst_uid: Remove spurious TERRNO from tst_get_free_gid success path linuxtestproject.agent
2026-07-23 12:39   ` [LTP] [PATCH v12 1/3] " Andrea Cervesato via ltp
2026-07-23 23:28     ` Wei Gao via ltp
2026-07-22  4:47 ` [LTP] [PATCH v12 2/3] lib: New library function tst_get_free_uid Wei Gao via ltp
2026-07-23 12:43   ` Andrea Cervesato via ltp
2026-07-23 23:54     ` Wei Gao via ltp
2026-07-24  8:33       ` Andrea Cervesato via ltp
2026-07-22  4:47 ` [LTP] [PATCH v12 3/3] open16: allow restricted O_CREAT of FIFOs and regular files Wei Gao via ltp
2026-07-23 12:46   ` Andrea Cervesato 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=20260722044732.3547-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox