From 78cb10da696fcf619d345d6ea51e1552189bfcb9 Mon Sep 17 00:00:00 2001 From: "Emil J. Tywoniak" Date: Wed, 26 Feb 2025 12:06:54 +0100 Subject: [PATCH] improve mkdtemp error message --- kernel/yosys.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/yosys.cc b/kernel/yosys.cc index de25d20e2..0ff38e52f 100644 --- a/kernel/yosys.cc +++ b/kernel/yosys.cc @@ -413,8 +413,11 @@ std::string make_temp_dir(std::string template_str) # endif char *p = strdup(template_str.c_str()); + log_assert(p); char *res = mkdtemp(p); - log_assert(res != NULL); + if (!res) + log_error("mkdtemp failed for '%s': %s [Error %d]\n", + p, strerror(errno), errno); template_str = p; free(p);