Skip to content

Commit d92b509

Browse files
committed
Fix windows build
PR #12767 accidentally broke it. (cherry picked from commit 99041b4)
1 parent 8adc1f3 commit d92b509

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

src/libstore/local-store.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ LocalStore::LocalStore(
213213
state->stmts = std::make_unique<State::Stmts>();
214214

215215
/* Create missing state directories if they don't already exist. */
216-
createDirs(realStoreDir);
216+
createDirs(realStoreDir.get());
217217
if (readOnly) {
218218
experimentalFeatureSettings.require(Xp::ReadOnlyLocalStore);
219219
} else {

src/libutil/file-system.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,12 +419,12 @@ void createDir(const Path & path, mode_t mode)
419419
throw SysError("creating directory '%1%'", path);
420420
}
421421

422-
void createDirs(const Path & path)
422+
void createDirs(const fs::path & path)
423423
{
424424
try {
425425
fs::create_directories(path);
426426
} catch (fs::filesystem_error & e) {
427-
throw SysError("creating directory '%1%'", path);
427+
throw SysError("creating directory '%1%'", path.string());
428428
}
429429
}
430430

src/libutil/file-system.hh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,10 @@ void deletePath(const std::filesystem::path & path, uint64_t & bytesFreed);
171171

172172
/**
173173
* Create a directory and all its parents, if necessary.
174+
*
175+
* Wrapper around `std::filesystem::create_directories` to handle exceptions.
174176
*/
175-
void createDirs(const Path & path);
176-
inline void createDirs(PathView path)
177-
{
178-
return createDirs(Path(path));
179-
}
177+
void createDirs(const std::filesystem::path & path);
180178

181179
/**
182180
* Create a single directory.

0 commit comments

Comments
 (0)