Skip to content

Commit 55595b6

Browse files
authored
Merge pull request #4918 from YosysHQ/emil/explain-mkdtemp-errno
improve mkdtemp error message
2 parents 05c81b3 + 78cb10d commit 55595b6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

kernel/yosys.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,11 @@ std::string make_temp_dir(std::string template_str)
413413
# endif
414414

415415
char *p = strdup(template_str.c_str());
416+
log_assert(p);
416417
char *res = mkdtemp(p);
417-
log_assert(res != NULL);
418+
if (!res)
419+
log_error("mkdtemp failed for '%s': %s [Error %d]\n",
420+
p, strerror(errno), errno);
418421
template_str = p;
419422
free(p);
420423

0 commit comments

Comments
 (0)