Skip to content

Commit 78cb10d

Browse files
committed
improve mkdtemp error message
1 parent b4a1695 commit 78cb10d

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)