From ff1ed506bd8a82a89b7751e36fb5e646605b9a41 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Wed, 19 Jan 2022 15:03:55 +1000 Subject: [PATCH] fs/tmp: add forgotten test suite --- fs/tmp_posix.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/tmp_posix.cpp b/fs/tmp_posix.cpp index 14c19afe..7195073c 100644 --- a/fs/tmp_posix.cpp +++ b/fs/tmp_posix.cpp @@ -18,7 +18,6 @@ cruft::fs::mktmpdir (void) { // The pattern suffix we'll append to the temp directory. // - // * It needs a slash to ensure we don't try to create a new directory. // * We might as well append the package name for clarity // * The libc call REQUIRES the string end with "XXXXXX" char const SUFFIX[] = "/" PACKAGE_NAME "-XXXXXX"; @@ -26,11 +25,11 @@ cruft::fs::mktmpdir (void) auto const root = cruft::paths::temp (); std::string path; path.reserve (root.string ().size () + sizeof (SUFFIX)); - path = root.string (); + path = root.string (); path += SUFFIX; if (!mkdtemp (path.data ())) cruft::posix::error::throw_code (); - return path; + return std::filesystem::path (path); }