]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests/nolibc: correctly report errors from printf() and friends
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>
Fri, 4 Jul 2025 13:43:13 +0000 (15:43 +0200)
committerThomas Weißschuh <linux@weissschuh.net>
Sun, 6 Jul 2025 09:02:40 +0000 (11:02 +0200)
commit4a40129087a4c32135bb1177a57bbbe6ee646f1a
tree5d33f393134161c99bca94f40b5205ee61b96fff
parent2b1ed5f7f8ab82597abfff56a39f056f8592df43
selftests/nolibc: correctly report errors from printf() and friends

When an error is encountered by printf() it needs to be reported.
errno() is already set by the callback.

sprintf() is different, but that keeps working and is already tested.

Also add a new test.

Fixes: 7e4346f4a3a6 ("tools/nolibc/stdio: add a minimal [vf]printf() implementation")
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20250704-nolibc-printf-error-v1-2-74b7a092433b@linutronix.de
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
tools/include/nolibc/stdio.h
tools/testing/selftests/nolibc/nolibc-test.c