mirror of https://github.com/YosysHQ/yosys.git
improve mkdtemp error message
This commit is contained in:
parent
b4a169527d
commit
78cb10da69
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue