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);