Skip to content

Commit a0474b8

Browse files
zhang jiaoshuahkh
authored andcommitted
selftests: kselftest: Use strerror() on nolibc
Nolibc gained an implementation of strerror() recently. Use it and drop the ifndef. Signed-off-by: zhang jiao <zhangjiao2@cmss.chinamobile.com> Acked-by: Thomas Weißschuh <linux@weissschuh.net> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent af1ec38 commit a0474b8

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

tools/testing/selftests/kselftest.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -373,15 +373,7 @@ static inline __noreturn __printf(1, 2) void ksft_exit_fail_msg(const char *msg,
373373

374374
static inline __noreturn void ksft_exit_fail_perror(const char *msg)
375375
{
376-
#ifndef NOLIBC
377376
ksft_exit_fail_msg("%s: %s (%d)\n", msg, strerror(errno), errno);
378-
#else
379-
/*
380-
* nolibc doesn't provide strerror() and it seems
381-
* inappropriate to add one, just print the errno.
382-
*/
383-
ksft_exit_fail_msg("%s: %d)\n", msg, errno);
384-
#endif
385377
}
386378

387379
static inline __noreturn void ksft_exit_xfail(void)

0 commit comments

Comments
 (0)