diff options
author | Andre Przywara <andre.przywara@arm.com> | 2021-03-19 17:53:34 +0100 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2021-03-24 16:43:20 +0100 |
commit | 75347add03e0fa60ecf2f79e41ec2152b8504593 (patch) | |
tree | 986b06915f8119b666e4397465e1092e38957377 /tools/testing/selftests/arm64/mte | |
parent | kselftest/arm64: mte: Fix clang warning (diff) | |
download | linux-75347add03e0fa60ecf2f79e41ec2152b8504593.tar.xz linux-75347add03e0fa60ecf2f79e41ec2152b8504593.zip |
kselftest/arm64: mte: Report filename on failing temp file creation
The MTE selftests create temporary files in /dev/shm, for later mmap-ing
them. When there is no tmpfs mounted on /dev/shm, or /dev/shm does not
exist in the first place (on minimal filesystems), the error message is
not giving good hints:
# FAIL: Unable to open temporary file
# FAIL: memory allocation
not ok 17 Check initial tags with private mapping, ...
Add a perror() call, that gives both the filename and the actual error
reason, so that users get a chance of correcting that.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Mark Brown <broone@kernel.org>
Link: https://lore.kernel.org/r/20210319165334.29213-12-andre.przywara@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'tools/testing/selftests/arm64/mte')
-rw-r--r-- | tools/testing/selftests/arm64/mte/mte_common_util.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/arm64/mte/mte_common_util.c b/tools/testing/selftests/arm64/mte/mte_common_util.c index 040abdca079d..f50ac31920d1 100644 --- a/tools/testing/selftests/arm64/mte/mte_common_util.c +++ b/tools/testing/selftests/arm64/mte/mte_common_util.c @@ -337,6 +337,7 @@ int create_temp_file(void) /* Create a file in the tmpfs filesystem */ fd = mkstemp(&filename[0]); if (fd == -1) { + perror(filename); ksft_print_msg("FAIL: Unable to open temporary file\n"); return 0; } |