From: Joel Rosdahl Date: Sat, 5 Aug 2023 07:12:34 +0000 (+0200) Subject: refactor: Remove use of mkdir(2) X-Git-Tag: v4.9~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e5b6f15c8a8b5cec3443149aae0147253180a41;p=thirdparty%2Fccache.git refactor: Remove use of mkdir(2) --- diff --git a/src/util/wincompat.hpp b/src/util/wincompat.hpp index e8c875d79..3aea7ab41 100644 --- a/src/util/wincompat.hpp +++ b/src/util/wincompat.hpp @@ -1,4 +1,4 @@ -// Copyright (C) 2021-2022 Joel Rosdahl and other contributors +// Copyright (C) 2021-2023 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -81,7 +81,6 @@ const mode_t S_IWUSR = mode_t(_S_IWRITE); // clang-format on # undef WIN32_NO_STATUS # include -# define mkdir(a, b) _mkdir(a) // Protect against incidental use of MinGW execv. # define execv(a, b) do_not_call_execv_on_windows diff --git a/unittest/test_util_DirEntry.cpp b/unittest/test_util_DirEntry.cpp index 044342aa8..a9426f4ae 100644 --- a/unittest/test_util_DirEntry.cpp +++ b/unittest/test_util_DirEntry.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -37,6 +38,8 @@ using TestUtil::TestContext; using util::DirEntry; +namespace fs = util::filesystem; + namespace { bool @@ -317,7 +320,7 @@ TEST_CASE("Directory") { TestContext test_context; - REQUIRE(mkdir("directory", 0456) == 0); + REQUIRE(fs::create_directory("directory")); DirEntry entry("directory"); CHECK(entry);