From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] safe_macros: Fix confusing safe_read() failure output
Date: Thu, 9 Jan 2025 17:18:51 +0100 [thread overview]
Message-ID: <20250109161851.GB355678@pevik> (raw)
In-Reply-To: <20250109150336.25235-1-chrubis@suse.cz>
Hi Cyril, Andrea
> In the case that we read() less bytes than expected in the strict mode
> we used the same tst_brk() as for the case when read() fails. However
> for short reads the errno is in an udefined state and we possibly end up
> with confusing TBROK message. Andrea reported EACESS ernno in the TBROK
nit: s/ernno/errno/
> message on a short read() while developing tests.
Good catch!
Reviewed-by: Petr Vorel <pvorel@suse.cz>
FYI safe_write() also has TERRNO in len_strict.
Kind regards,
Petr
+++ lib/safe_macros.c
@@ -554,7 +554,7 @@ ssize_t safe_write(const char *file, const int lineno, void (cleanup_fn) (void),
if (len_strict == SAFE_WRITE_ALL) {
if ((size_t)rval != nbyte)
- tst_brkm_(file, lineno, TBROK | TERRNO,
+ tst_brkm_(file, lineno, TBROK,
cleanup_fn, "short write(%d,%p,%zu) "
"return value %zd",
fildes, buf, nbyte, rval);
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-01-09 16:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-09 15:03 [LTP] [PATCH] safe_macros: Fix confusing safe_read() failure output Cyril Hrubis
2025-01-09 16:18 ` Petr Vorel [this message]
2025-01-16 11:15 ` Cyril Hrubis
2025-01-16 11:19 ` Petr Vorel
2025-01-16 12:01 ` Cyril Hrubis
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=20250109161851.GB355678@pevik \
--to=pvorel@suse.cz \
--cc=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/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