Signed-off-by: Waldemar Kozaczuk <jwkozac...@gmail.com> --- tests/misc-fs-stress.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tests/misc-fs-stress.cc b/tests/misc-fs-stress.cc index 079ebb48..7955db64 100644 --- a/tests/misc-fs-stress.cc +++ b/tests/misc-fs-stress.cc @@ -51,7 +51,14 @@ int main(int argc, char const *argv[]) if (argc == 2) { fname = argv[1]; } else { - mktemp(default_fname); + // Use mkstemp to capture name of a temporary file + auto fd = mkstemp(default_fname); + if (fd <= 0) { + perror("mkstemp"); + return -1; + } + close(fd); + unlink(default_fname); fname = reinterpret_cast<const char *>(default_fname); } -- 2.20.1 -- You received this message because you are subscribed to the Google Groups "OSv Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/osv-dev/20191209030913.1842-1-jwkozaczuk%40gmail.com.