diff options
author | Muhammad Usama Anjum <usama.anjum@collabora.com> | 2024-04-04 19:14:33 +0300 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2024-05-06 22:57:19 +0300 |
commit | 9c84b890b8f60c4dfb69f4ba206949db72fd2416 (patch) | |
tree | 3a53953def04421daf35065a0c153a3534efd645 | |
parent | 86483f8b4e8d3eb364bfa9049b46fea3578af050 (diff) | |
download | linux-9c84b890b8f60c4dfb69f4ba206949db72fd2416.tar.xz |
selftests: exec: Use new ksft_exit_fail_perror() helper
Use ksft_exit_fail_perror() to print the value of errno and its string
form. This is the first user of the ksft_exit_fail_perror() and proves
the usefulness of this API.
Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
-rw-r--r-- | tools/testing/selftests/exec/recursion-depth.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/testing/selftests/exec/recursion-depth.c b/tools/testing/selftests/exec/recursion-depth.c index b2f37d86a5f6..438c8ff2fd26 100644 --- a/tools/testing/selftests/exec/recursion-depth.c +++ b/tools/testing/selftests/exec/recursion-depth.c @@ -37,25 +37,25 @@ int main(void) ksft_test_result_skip("error: unshare, errno %d\n", errno); ksft_finished(); } - ksft_exit_fail_msg("error: unshare, errno %d\n", errno); + ksft_exit_fail_perror("error: unshare"); } if (mount(NULL, "/", NULL, MS_PRIVATE | MS_REC, NULL) == -1) - ksft_exit_fail_msg("error: mount '/', errno %d\n", errno); + ksft_exit_fail_perror("error: mount '/'"); /* Require "exec" filesystem. */ if (mount(NULL, "/tmp", "ramfs", 0, NULL) == -1) - ksft_exit_fail_msg("error: mount ramfs, errno %d\n", errno); + ksft_exit_fail_perror("error: mount ramfs"); #define FILENAME "/tmp/1" fd = creat(FILENAME, 0700); if (fd == -1) - ksft_exit_fail_msg("error: creat, errno %d\n", errno); + ksft_exit_fail_perror("error: creat"); #define S "#!" FILENAME "\n" if (write(fd, S, strlen(S)) != strlen(S)) - ksft_exit_fail_msg("error: write, errno %d\n", errno); + ksft_exit_fail_perror("error: write"); close(fd); |