From 8b2d0814646f5b6112b400a43876c3dcc7c60706 Mon Sep 17 00:00:00 2001 From: Kurt McMillan Date: Tue, 7 Apr 2026 16:56:13 +0000 Subject: [PATCH] test: Improve error message when creating temporary file fails --- test/common/test-common.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/common/test-common.h b/test/common/test-common.h index ec847705..3ccfd514 100644 --- a/test/common/test-common.h +++ b/test/common/test-common.h @@ -8,7 +8,9 @@ #include "hipfile.h" #include "magic-word.h" +#include #include +#include #include #include #include @@ -73,8 +75,10 @@ struct Tmpfile { path += "/hipFile.XXXXXX"; if ((fd = mkstemp(path.data())) == -1) { + int mkstemp_err{errno}; umask(old_umask); - throw std::runtime_error("Could not create temporary file"); + throw std::runtime_error("Could not create temporary file " + path + ": " + + std::string(std::strerror(mkstemp_err))); } umask(old_umask);